Get to know MDN better
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年9月.
repeat() は String 値のメソッドで、呼び出し元の文字列を指定した数だけコピーして結合した新しい文字列を構築して返します。
0 から Infinity までの間の整数で、文字列を繰り返す数を示します。
与えられた文字列の指定した回数分のコピーを含む新しい文字列です。
count が負の数であるか、 count が文字列の最大長を超えた場合に発生します。
| ECMAScript® 2027 Language Specification # sec-string.prototype.repeat |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2025年8月22日 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.