re: 10 JavaScript string methods you should know VIEW POST

VIEW PARENT COMMENT VIEW FULL DISCUSSION

Actually repeat is easy to read

If you want to make string of 52 a's with repeat is so easy

  const a = 'a'.repeat(52);
  console.log(a); // "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  console.log(a.length); // 52

Array index starts from 0 which means it will print 52 times.

code of conduct - report abuse