javascript - Why does this give me an error? -
var nop = {}; var f = {}; [nop.foo] = (f.foo || undefined);
note f.foo
not present.
returns following error:
uncaught typeerror: cannot read property 'symbol(symbol.iterator)' of undefined
why?
it seems reason destructuring [nope.foo]
not matching (whatever)
you'd better change so:
var nop = {}; var f = {}; [nop.foo] = [(f.foo || 23)]; console.log(nop)
Comments
Post a Comment