One aspect of me when trying out Javascript as a new language of Fun(tm) was .. that it actually was a WTF experience. Thought that was simply my own stupidity.. But now im rather convinced that i just stumbled upon those countless strange effects of js, when writing code. Just noting an interesting read here, in case there are devs, that expereinced the same WTFs as me and are some kind frustrated when asked about "youKnowWhich". Just read following snippet and make up your mind....
function laugh()
{
return
{
haha: "ha!"
};
}
laugh();
// returns undefined
function laugh() {
return { haha: "ha!" };
}
laugh();
// returns Object: { haha: "ha!" }