We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 14f1d2e commit 1658160Copy full SHA for 1658160
index.js
@@ -163,6 +163,14 @@ function sort_nums(arr, reverse = false) {
163
}
164
165
166
+/**
167
+ * Deep copy of array
168
+ *
169
+ * @param array arr
170
+ * @returns array
171
+ */
172
+const array_copy = (arr) => arr.map(item => Array.isArray(item) ? array_copy(item) : item);
173
+
174
export {
175
is_array,
176
is_num_array,
@@ -178,4 +186,5 @@ export {
178
186
array_sum,
179
187
array_slice_sum,
180
188
sort_nums,
189
+ array_copy,
181
190
};
0 commit comments