Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript splice without changing array

var myArray = ["one", "two", "three"];
var cloneArray = myArray.slice();

myArray.splice(1, 1);

console.log(myArray);
console.log(cloneArray);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #splice #changing #array
ADD COMMENT
Topic
Name
8+8 =