“TS powtórz ciąg” Kod odpowiedzi

TS powtórz ciąg

export const repeatStr = (n: number, s: String): String => s["repeat"](n);
Puzzled Puffin

TS powtórz ciąg

export const repeatStr = (n: number, s: string) => Array(n + 1).join(s);
Puzzled Puffin

TS powtórz ciąg

export function repeatStr(n: number, s: string): string {
  return s.repeat(n);
}
Puzzled Puffin

TS powtórz ciąg

export function repeatStr(n: number, s: string): string {
  return ''.padStart(n * s.length, s);
}
Puzzled Puffin

Odpowiedzi podobne do “TS powtórz ciąg”

Pytania podobne do “TS powtórz ciąg”

Więcej pokrewnych odpowiedzi na “TS powtórz ciąg” w TypeScript

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu