본문 바로가기

JavaScript

JavaScript Tip (1) - saving array into another array

When you want to save an array into another array

wrong example code
wrong example result

Arrays in another array will become same as above.

But there's a real simple way to fix it with array.flat([])

Let's give it a try.

Correct example code

if you exchange push array as above

correct example result

You can see the correct form!