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

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -