In JS, const rat = [[5, 5], 5, [[5],5]].flat(); throws ".flat() is not a function". Why?

Seems like it should work, though.

It worked for me. Make sure that you typed everything correctly.

It’s working for me in the console! Just not in the Codecademy activity.

flat is broken 2