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



— 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