Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Clone an array using the JavaScript slice() method

var numbers = [1, 2, 3, 4, 5];
var clonedNumbers = numbers.slice();
console.log("Cloned Numbers are:", clonedNumbers)
Source by itsjavascript.com #
 
PREVIOUS NEXT
Tagged: #Clone #array #JavaScript #method
ADD COMMENT
Topic
Name
6+4 =