javascript - Why does the variable executes the window object right away and not store it instead? -


i understand what's happening code in variable not stored immediately, instead executed first before can called. example code can (in global scope):

var alertme = alert("i\'m being executed stored called again, why?");  

because storing result of calling function, not storing function.

this after:

var alertme = function () {          alert("i\'m being executed stored called again, why?");      }; 

and when want call it:

alertme(); 

Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -