stuart-d2
3/18/2016 - 4:00 PM

Array - Clone Using the slice(0) method.

Array - Clone Using the slice(0) method.

var fruits = ['banana', 'orange', 'apple', 'mango'];

>fruits
<["banana", "orange", "apple", "mango"]

>var fruitClone = fruits.slice(0);

>fruitClone
<["banana", "orange", "apple", "mango"]