JavaScript
31K subscribers
1.23K photos
10 videos
33 files
899 links
A resourceful newsletter featuring the latest and most important news, articles, books and updates in the world of #javascript 🚀 Don't miss our Quizzes!

Let's chat: @nairihar
Download Telegram
CHALLENGE

const arr = [1, [2, 3], [4, [5, 6]]];
const a = arr.flat();
const b = arr.flat(Infinity);
const c = arr.flatMap(x => Array.isArray(x) ? x : [x, x]);
console.log(a, b, c);
❤2