mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-23 00:45:16 +00:00
13 lines
241 B
JavaScript
13 lines
241 B
JavaScript
function cloneArray(array) {
|
|
var cloned = array.slice(0);
|
|
|
|
for (var i = 0, l = cloned.length; i < l; i++) {
|
|
if (Array.isArray(cloned[i]))
|
|
cloned[i] = cloneArray(cloned[i]);
|
|
}
|
|
|
|
return cloned;
|
|
}
|
|
|
|
module.exports = cloneArray;
|