This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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 ??