Web programming: the immediately invoked function expression (IIFE)
Self-tutoring about web programming: the tutor brings up IIFE.
It’s been my experience that a function need be called to run, but perhaps not always. Apparently, in JavaScript, the construction
(function(){
//
function code lines
//
})();
//
function code lines
//
})();
will run spontaneously.
I’ve tried it with success:)
Source:
Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.
Leave a Reply
You must be logged in to post a comment.