const a = [1, 2, 3];
const b = a.flatMap(x => [x, x * 2]);
console.log(b);
Ответ: 1, 2, 2, 4, 3, 6
JavaScript test | #JavaScript
JA JavaScript test @js_test · 9.7K subscribers
const a = [1, 2, 3];
const b = a.flatMap(x => [x, x * 2]);
console.log(b);