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 -

Google Cloud Bigtable Durability/Availability Guarantees -

php variable $_SERVER['SERVER_ADDR'] is blank when using crontab -