I got a JavaScript source code, and I don not understand something in this. Could you help me please, what does it mean?
Partnerek = (function () {
Partnerek = function () { }
//there are functions in this way
//I think this is a public function
Partnerek.foo = function foo()
{
//code
}
//there are functions in this way
//this is a non public function
function foosecondway()
{
//code
}
return Partnerek;
})()
It seems like a class, but this is not a class.
- What is this?
- Why Did the programmer write in this way?
- Is this a good way?
- What is the return value?
- Is the two function "Parameter" same in the code?