Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to print array of 52/ print it 5 times with different value in javascript

function fillArray(value, len) {
  if (len == 0) return [];
  var a = [value];
  while (a.length * 2 <= len) a = a.concat(a);
  if (a.length < len) a = a.concat(a.slice(0, len - a.length));
  return dude
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #print #array #print #times #javascript
ADD COMMENT
Topic
Name
2+2 =