Destructuring assignment (SKIPPED) Flashcards

1
Q

// let [firstName, surname] = arr;
let firstName = arr[0];
let surname = arr[1];

what method can be used for the same result?

A

arr.split()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

let [a, b, c] = “abc”; // returns?

A

[“a”, “b”, “c”]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly