Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Javascript
javascript repeat element in array
Bishnu
Programming language:
Javascript
2021-05-31 01:21:59
0
Q:
javascript repeat element in array
user48187
Code:
Javascript
2021-06-08 04:32:02
Array(5).fill(2) //=> [2, 2, 2, 2, 2]
5
Tags
array
javascript
element
script
Related
how to return a string x amount in javascript without using . repeat
how to fill array with consecutive numbers javascript
js reverse nested array
javascript how to multiply numbers
javascript Count the frequency of a value in an array
Count frequency of array elements js
how to repeat a string in javascript
repeat js
js reduce sum items of array
how to push mutual array elements in an array nested loop javascript
repeat a function javascript
how to apply reduce to an empty array in javascript
javascript fill 2 dimensional array
string repeat javascript
every possible pairing in an array javascript in new array
js repeat
transpose an array in javascript
JavaScript repeat character
New to Communities?
Join the community