bbcts
bbcts

Reputation: 25

JavaScript Spread Operator while making a shallow copy of an array

let arr = [1,2,3]
let arr2 = [...arr]
let [...arr3] = arr

The arr2 and arr3, both make a shallow copy of arr. What is actually the difference?

Upvotes: 2

Views: 87

Answers (0)

Related Questions