This might be a stupid question but I have looked everywhere and coming to SO as the last resort. My doubt is an IIFE function usually looks like this
var me = (function() { /*code*/} )();
me();
I have not seen any code that has variables passed down into it so far. Is it possible to pass down values to an IIFE function? I have already tried using
var Person = (function(name,age){
this.name = name;
this.age = age;
}());
Person("Bob Smith", 30);
which gives me an undefined error.
So is there a way to pass down these values into an IIFE or should it be avoided?