Consider the following example
Now in testing the code in firebug i realize i could call the function as
although the above method does call the function but it also gives an output of undefined.Why does it give undefined.
Furthermore in other scripts i have seen functions such as above in maps being called as
var b = new m.funct();--->B
I wanted to know which is correct (A or B) and when should "new" be used.Because in most of java script code if i remove the new portion , the code doesnt work .
Why is that ??