DEV Community

Discussion on: How do you write an empty array?

Collapse
 
mbougarne profile image
Mourad Bougarne • Edited

The samplist way is :

let myArr = [[],[],[]]

With spread operator:

let arr1 = [[],[]]
let arr2 = [[],...arr1]

We can use it with new Array(3) fill() and map()