Friday, July 10, 2020

Create an array with same element repeated multiple times

In ES6 using Array fill() method
Array(5).fill(2)

0 comments:

Post a Comment