xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

js arrow function return object

js arrow function return object

bug

    filterData: {
        type: Object,
        default: () => {},
        required: true,
    },

OK

    filterData: {
        type: Object,
        default: () => ({}),
        required: true,
    },

test

app = () => {};
() => {}
app();
undefined
app = (a) => {K: a};
(a) => {K: a}
app(x);
VM71221:1 Uncaught ReferenceError: x is not defined
    at <anonymous>:1:5
(anonymous) @ VM71221:1
app(`x`);
undefined
x = app(`x`);
undefined
x;
undefined
app = (a) => ({K: a});
(a) => ({K: a})
x = app(`x`);
{K: "x"}

refs



©xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2021-01-26 15:17  xgqfrms  阅读(88)  评论(11编辑  收藏  举报