Skip to content
Advertisement

Tag: javascript-objects

Destructuring In JavaScript and Initialization

How does initialization work in JavaScript? I am getting an error on the below code saying cannot access obj before initialization. Answer It’s because you’re relying on Automatic Semicolon Insertion and no automatic semicolon is added after the const obj… line. Without one, that line and the following one are treated as one expression which does indeed try to access

Advertisement