I have 2 identical functions. But they return 2 different things..
function fun1()
{
return {
obj: "hello"
};
}
function fun2()
{
return
{
obj: "World..!"
};
}
So, when i add something to print out the functions,
console.log("fun1 returns:");
console.log(fun1());
console.log("fun2 returns:");
console.log(fun2());
My O/p is:
fun1 returns:
Object {obj: "hello"}
fun2 returns:
undefined
Why does this happen. Is this a structural mistake?? How do i get to make the 2nd function print out identical o/p??