0

I am trying to reuse the variables first and second, I am able to update the variable directly, but I can't reuse them for another destructuring statement.

let [first, second] = [1, 2]
[first, second] = [3, 4]

Variables are declared using let, so we can reassign. But, I am getting a runtime error

10

1 Answer 1

-3

first, you must declare a new type object has two property first, second

var varaibale = {first:1, second:2};
varaibale.first = 3;
varaibale.second = 4;
console.log(varaibale);
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.