我写了2个javascript函数,但它们的工作方式不同.
console.log(func2());未定义.谁能告诉我为什么以及如何解决这个问题?
function func1()
{
return {
bar: "hello"
};
}
function func2()
{
return
{
bar: "hello"
};
}
console.log(func1());
console.log(func2());Run Code Online (Sandbox Code Playgroud)
javascript ×1