10x mate :-) , it's always important to refresh the basics.
In Q8 - Running the code in Node will result undefined , see more details : stackoverflow.com/questions/602986...
Thank you for the response. It's is very helpful. You right, The window object exists only in the browser (client-side). I wanted to show the basic concepts of javascript. The scope of node js it's a little bit different. You can create a global variable by doing global.length (not recommended) - but without it, I think this won't know what length is. if you that in node.js it will work:
10x mate :-) , it's always important to refresh the basics.
In Q8 - Running the code in Node will result undefined , see more details :
stackoverflow.com/questions/602986...
Thank you for the response. It's is very helpful. You right, The window object exists only in the browser (client-side). I wanted to show the basic concepts of javascript. The scope of node js it's a little bit different. You can create a
globalvariable by doingglobal.length(not recommended) - but without it, I thinkthiswon't know whatlengthis. if you that in node.js it will work: