j
Size: a a a
j
КП
j
j
j
D
КП
НК
НК
function openArray(array) {
array.reduce(function(result, current) {
if(Array.isArray(current)) {
result.concat(openArray(current));
} else {
result.concat(current);
}
});
}
НК
НК
j
j
j
НК
function openArray(array) {
let newArray = [];
return array.reduce(function(result, current) {
console.log(result)
console.log(current)
if(Array.isArray(current)) {
newArray = result.concat(openArray(current));
} else {
newArray = result.concat(current);
}
});
}
НК
НК
НК
НК
const openArray = array => array.reduce((result, current) => Array.isArray(current) ? result.concat(expand(current)) : result.concat(current), []);
НК