_mercury
_mercury2y ago

_mercury – 22-39 Jul 27

how to create an array in js with same value 100 times ?
3 Replies
Eva
Eva2y ago
Array.from({ length: 100 }, () => value); The function also gives you item (undefined) and index if you want to generate some array basing off indices
_mercury
_mercury2y ago
great thanx
reactibot
reactibot2y ago
This thread hasn’t had any activity in 12 hours, so it’s now locked. Threads are closed automatically after 12 hours. If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/565213527673929729/1001982148653367377