MJ
asked on
Purpose of returning an anonymous function?
What is the purpose of using the return leading the function? Does it matter as long as you are returning within the function?
return (function() {
"use strict";
var u12Value ;
try {
if(!!document.cookie && document.cookie.indexOf("CUSTOMER")!==-1) {
u12Value = 1;
}
else
{
u12Value = 0;
}
}catch(e) {}
return u12Value;
})();
It's just an inline function declared right when returning value. As long as that return statement is inside a function, it should be just fine.
ASKER
Hi Duy,
So the return is not necessary then?
So the return is not necessary then?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.