programming-examples/js/Array/Write a JavaScript function to clone an array..js
2019-11-15 12:59:38 +01:00

5 lines
158 B
JavaScript

array_Clone = function(arra1) {
return arra1.slice(0);
};
console.log(array_Clone([1, 2, 4, 0]));
console.log(array_Clone([1, 2, [4, 0]]));