How to create an array with repeating elements

is there a way of writing with advanced points like ["axiomagy",",

Feb.28,2021

function getArr ($count)
{

$str = 'abc';
$arr = array();
for($i=0;$i<$count;$iPP)
{
    $rand = rand(0,2);
    $arr[] = $str[$rand];
}

}
$count is the number of arrays you want to create, mainly using a character that can be obtained by subscript


function repeatArr(arr, len, start) {
  var ret = [];
  for (var i = start || 0; i < len; iPP) {
    ret.push(arr[i%arr.length]);
  }
  return ret;
}
repeatArr('abcde'.split(''), 10);
//["a", "b", "c", "d", "e", "a", "b", "c", "d", "e", "a", "b", "c", "d"]
function repeatArr(arr, repeats) {
  var ret = [];
  for (var i = 0; i < repeats.length; iPP) {
    for (var j = repeats[i][0]; j < repeats[i][1]; jPP) {
      ret.push(arr[j % arr.length]);
    }
  }
  return ret;
}
repeatArr('abcde'.split(''), [[0, 5], [0, 3], [0, 3]]);
//["a", "b", "c", "d", "e", "a", "b", "c", "a", "b", "c"]

Array (10000). Fill (0). Map (o = > String.fromCharCode (Math.floor (Math.random () * 26) + 97))

Menu