Menu
Hi everyone!
I am getting deeper in the namespace pattern in JavaScript, and have come across this code patter several times:
[code]
var myApp = function (namespace, undefined)
{
namespace = namespace || {} ;
//do stuff…
return namespace;
}(myApp);
It is passing ‘undefined’ as the second parameter.
What is the purpose of ‘undefined’ as the second parameter in the function??
Thank you very much!