JS Interview - Arrays - Question 8

preview_player
Показать описание
This episode covers how to create Arrays of a specific length which will be pre-populated with different values. In this case we are filling them with a series of random numbers.

Рекомендации по теме
Комментарии
Автор

This filling array with random numbers is dope!

Horoe
Автор

Thanks Steve for such a wonderful series. Lot to learn. I love your visual studio setup.

bikramchettri
Автор

Now with ES6 this would also do the trick: [...new

Gobli
Автор

Thanks for the videos! For the second solution, is this also valid: new Array(5).fill(Math.random()) ?

braca
Автор

The current solution has a possibility of creating the pre-existing random number again.How can we correct it?

Jatin-eykq
Автор

why is this not working?
new Array(5).map(item => Math.random())

jasbindarsingh