Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

repeat array in js

const makeRepeated = (arr, repeats) =>
  [].concat(...Array.from({ length: repeats }, () => arr));
  
console.log(makeRepeated([1, 2, 3], 2));
Comment

PREVIOUS NEXT
Code Example
Javascript :: package.json: License should be a valid SPDX license expression 
Javascript :: javascript change class of item 
Javascript :: javascript group by on array of objects 
Javascript :: javascript search in array of strings 
Javascript :: require statement not part of import statement javascript 
Javascript :: discord.js get attachment url 
Javascript :: how to update node js version 
Javascript :: javascript print subarray from index to indeex 
Javascript :: how to get date time day year in javscript 
Javascript :: sanitise string js 
Javascript :: javascript object toarray 
Javascript :: js get paste text 
Javascript :: redirecting in react 
Javascript :: enable select jquery 
Javascript :: create stack navigator has been moved to react-navigation-stack 
Javascript :: js get transition duration 
Javascript :: disable eslint next line 
Javascript :: addeventlistener keydown 
Javascript :: fontawesome in next js 
Javascript :: javascript get last character of string 
Javascript :: how to set view engine in express 
Javascript :: javascript loop through object values 
Javascript :: conditinally add object js 
Javascript :: how to check if localhost javascript 
Javascript :: javascript remoev css class 
Javascript :: for key value in object javascript 
Javascript :: aos library animation angular 
Javascript :: classname toggle js 
Javascript :: jquery translate 
Javascript :: randomColor 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =