moringaman
4/6/2018 - 1:38 AM

Contructing Arrays from multiple calls Array().fill().map()

myArray = ["a", "b", "c"]

Array(parseInt(myArray.length)).fill().map((element, index) =>  myArray[index])
/* Yealds => (3) ["a", "b", "c"]
0:"a"
1:"b"
2:"c"