mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-25 09:55:15 +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;
|