Answer the question
In order to leave comments, you need to log in
How to beautifully pick up all array elements in an array?
There is an array arr
and in it a couple more arrays 0_arr
and 1_arr
. I need to transfer everything that is in the array arr
to a new array arrNew
without grouping into arrays. How to make it beautiful? So far, only this option has come to mind, but something tells me that it is crooked.
let arrNew = [];
arr.forEach(function(item) {
item.forEach(function(item) {
arrNew.push(item);
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question