0
const result = something[dynamicValue]

Given the above code, I can get error of Cannot read property 'x' of null because something is undefined, how do I fallback check to void error? should I do something like this

const result = something && something[dynamicValue]
2

0

Browse other questions tagged or ask your own question.