javascript copy items into another array code example
Example: javascript copy items into another array
var oldColors=["red","green","blue"];
var newColors = oldColors.slice(); //make a clone/copy of oldColors
var oldColors=["red","green","blue"];
var newColors = oldColors.slice(); //make a clone/copy of oldColors