Creating and Filling an Array in Javascript


Create an array of a certain length and fill it with a specific value.

Source Code

let filledArray = new Array(5).fill('value');
console.log(filledArray);
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments