Invoke anonymous function in .js

/ Published in: JavaScript
Save to your folder(s)

Good for isolating code inside from global vars. Example, pass jquery references from the window scope

Copy this code and paste it in your HTML
  1. (function(){
  2. alert('invoke moi')
  3. })();

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.