Hmm, that's annoying behaviour. This doesn't give a runtime error:
var [a,b,c] = [1]
Either way, I'd highly recommend just using TypeScript. var [a,b,c] = [1]
Either way, I'd highly recommend just using TypeScript. var [a, b, c] = null
and this (destructing a nested array) var [[a]] = []
the point of the "elvis" ?. operator is to make accessing properties _of_ optional values or other optional properties easier."Either way, I'd highly recommend just using TypeScript."
Sure, I'd recommend that too, but in this case it "only" helps us by moving the error from runtime to compile-time, nested optional property access remains ugly in the TS world, too. The ?. operator will come to TypeScript as soon as it comes to EcmaScript.