版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_24147051/article/details/81317087
下面两个函数是不等价的
foo1 = () =>
{
return {
bar: "hello"
};
}
foo2 = () =>
{
return
{
bar: "hello"
};
}
console.log(foo1()); // {bar : "hellp"}
console.log(foo2()); // undefined
效果: