** I have created two functions with different name & same properties and when I was checking surprisingly it's giving me different output. I don't understand what was is the problem exactly. I was expecting same result for both functions. See the below code**
function foo1()
{
return {
bar: "hello"
};
}
function foo2()
{
return
{
bar: "hello"
};
}
console.log("foo1 returns:");
console.log(foo1());
console.log("foo2 returns:");
console.log(foo2());
Below is the Output:
foo1 returns:
Object {bar: "hello"}
foo2 returns:
undefined