panicbus
2/20/2017 - 11:41 PM

How to call an IIFE (immediately invoked function expression)

How to call an IIFE (immediately invoked function expression)

var pos = "reverse cowgirl";
var hair = 'platinum';

(function(name, pos, hair){
  var greet = "Hi, my name's ";
  console.log(greet + name + ". I have " + hair + " hair and I really love " + pos );
}('piper', pos, hair)); // you can use the argument here or from prev stated variables