var dayName = function() {
var names = ["Sunday", "Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday"];
return function(number) {
return names[number];
};
}();
console.log(dayName(1));
o/p->Monday
When the same code is executed without the paranthesis'()' at the end in the dayName variable O/P is different..What is the reason?