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

xslt - Substring before throwing error -

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

oracle - Changing start date for system jobs related to automatic statistics collections in 11g -