QuestenaPractice that shows what to review next
Question 60

What does [1, [2, [3]]].flat() return with the default depth?

  1. [1, [2, [3]]]
  2. [1, 2, [3]]Correct answer
  3. [1, 2, 3]
  4. [1, [2], [3]]

Explanation

The default flat depth removes one nesting level, so 2 joins the outer array while the array containing 3 remains nested. Producing a completely flat result would require flattening more deeply than the default.

Continue with this test

Start practice
Question 60: What does [1, [2, [3]]].flat() return with the default… · JavaScript Fundamentals · Questena