javascript - self execute function is not a function error -


var module = (function () {     console.log('hello world'); }()); 

the above function did work upon loading, means did self executed. when want run second time, wrote module(), doesn't work, why? don't want paste entire function body run again..

i tried on angularjs btw, either $scope.moudule() or module() work me.

self-execute result of attribution, you're storing result of self execution (in case nothing).

try this:

(module = function () {     console.log('hello world'); })(); 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -