javascript copying an array in a for loop code example Example: js clone array var clone = myArray.slice(0);