copy of array python code example
Example 1: copy array javascript
const sheeps = ['Apple', 'Banana', 'Juice'];
// Old way
const cloneSheeps = sheeps.slice();
// ES6 way
const cloneSheepsES6 = [...sheeps];
Example 2: create copy of an array python
new_list = list.copy()
Example 3: javascript copy array
var oldColors=["red","green","blue"];
var newColors = oldColors.slice(); //make a clone/copy of oldColors
Example 4: python copy list
a=[1,2,3,4]
b=a[:]
''' now b has all elements of a'''