What's the output?
const emojis = ['๐ฅ', ['โจ', 'โจ', ['๐', '๐']]];
console.log(emojis.flat(1));You missed this one before
With the flat method, we can create a new, flattened array. The depth of the flattened array depends on the value that we pass. In this case, we passed the value 1 (which we didn't have to, that's the default value), meaning that only the arrays on the first depth will be concatenated. ['๐ฅ'] and ['โจ', 'โจ', ['๐', '๐']] in this case. Concatenating these two arrays results in ['๐ฅ', 'โจ', 'โจ', ['๐', '๐']].
Question 131 ยท see the original (opens in a new tab)
or press Enter