programming-examples/js/Array/Write a JavaScript function to clone an array..js

5 lines
158 B
JavaScript
Raw Normal View History

2019-11-15 12:59:38 +01:00
array_Clone = function(arra1) {
return arra1.slice(0);
};
console.log(array_Clone([1, 2, 4, 0]));
console.log(array_Clone([1, 2, [4, 0]]));