Message from JavaScript discussions

June 2019

— Objects can implement a way they want to be converted to strings.
toString() is the method they implement

Message permanent page

— 

Http://latentflip.com/loupe/?code=JC5vbignYnV0dG9uJywgJ2NsaWNrJywgZnVuY3Rpb24gb25DbGljaygpIHsKICAgIHNldFRpbWVvdXQoZnVuY3Rpb24gdGltZXIoKSB7CiAgICAgICAgY29uc29sZS5sb2coJ1lvdSBjbGlja2VkIHRoZSBidXR0b24hJyk7ICAgIAogICAgfSwgMjAwMCk7Cn0pOwoKY29uc29sZS5sb2coIkhpISIpOwoKc2V0VGltZW91dChmdW5jdGlvbiB0aW1lb3V0KCkgewogICAgY29uc29sZS5sb2coIkNsaWNrIHRoZSBidXR0b24hIik7Cn0sIDUwMDApOwoKY29uc29sZS5sb2coIldlbGNvbWUgdG8gbG91cGUuIik7!!!PGJ1dHRvbj5DbGljayBtZSE8L2J1dHRvbj4%3D

— I suggest everyone to please go through the above link, which describes "how JavaScript's call stack, event loop, and callback queue interact with each other. Visualizing the javascript runtime at runtime"

Message permanent page

— Yesterday, I gone through those article. Awesome exploration by Philip Roberts :)

— Why does this happen

— It has always worked

— Let's say file has 4 chars
i = file.length
i will be 4
file[4] // undefined

— You should do:
let i = file.length - 1

— Because file[3] is the highest accessible int when file has length 4

— But it says nothing abouut the index variable

— Nope, it doesn't, and it shouldn't try to

— File[4] is undefined, you're passing undefined to process.stdout.write