repeat character string js code example Example: string repeat javascript // best implementation repeatStr = (n, s) => s.repeat(n);