Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

copy array javascript

const sheeps = ['Apple', 'Banana', 'Juice'];

// Old way
const cloneSheeps = sheeps.slice();

// ES6 way
const cloneSheepsES6 = [...sheeps];
Source by www.samanthaming.com #
 
PREVIOUS NEXT
Tagged: #copy #array #javascript
ADD COMMENT
Topic
Name
6+6 =