DEV Community

Discussion on: JS Array Manipulation Quirks

Collapse
 
link2twenty profile image
Andrew Bone

const newArr = arr.slice()

Is my favourite way to clone an array

Collapse
 
jenc profile image
Jen Chan

woah woah woah! Does it clone past 1 level deep?

Collapse
 
link2twenty profile image
Andrew Bone