THIS QUESTION HASN'T BEEN ANSWERED, THE SECONDARY ASPECT IS NOT THE POINT OF THE QUESTION
So i've come across some unexpected behaviour and was looking for an explanation. I'm assuming it's related to how Buffer formats data and how process.stdout.write reads data.
When running the below code, my output is 3 emoticons, a black and white smiley face - along with a heart. However when i run the same code and check it with console.log, which i was led to believe was just a wrapper for process.stdout.write, then it outputs the Buffer. What is the reason for this? My guess is that stdout.write reads the buffer in an encoding that designates the buffer as emoticon characters but if so then why doesn't console.log do the same?
const buf2 = Buffer.from([1,2,3])
process.stdout.write(buf2)