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

java - unable show chart in xls document using jasper reports -

javascript - How to change image src on success AJAX -

java.lang.RuntimeException: Could not generate dummy secret at sun.security.ssl.RSAClientKeyExchange.<init> -