I'm taking an online course which uses a bot to correct JavaScript code. The challenge is to
Create an array a
and make so that a.length === 2
is true
,
a[0].length === 1
is true
,,
and a.flat()
should 'print out' ['a', 'b' 'c']
The bot output tells me that 'defines a such that a[0].length === 1 evaluates to true'
isn't correct.
This is my code so far:
let a = ['a','b','c']
a.length === 2
a[0].length === 1
a.flat()
So far I've tried to put an array inside the array, but I can't figure out where to put the brackets, like this, but it doesn't work.
let a = [['a','b'],'c']
a.length === 2
a[0].length === 1
a.flat()