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年7月.
concat() は String 値のメソッドで、文字列引数を呼び出し文字列に連結して、新しい文字列を返します。
str に連結する 1 つ以上の文字列です。引数なしで String.prototype.concat() を呼び出すことは技術的には可能ですが、文字列は不変であるため、目に見えるコピーは行われません(Array.prototype.concat() と同様に)。これは、引数として文字列の配列をスプレッドしており、その配列がたまたま空である場合にのみ現れます。
提供された文字列を結合したテキストの入った新しい文字列です。
concat() 関数は、文字列引数を呼び出し文字列に連結し、新しい文字列を返します。
引数が文字列型でない場合は、連結前に文字列値に変換されます。
concat() メソッドは加算/文字列結合演算子 (+, +=) にとても似ていますが、concat() は引数を直接文字列に変換するのに対し、加算演算子はオペランドをまずプリミティブに変換します。詳しくは、 + 演算子のリファレンスページを参照してください。
複数の文字列を連結してコンソールに表示する例を以下に示します。
| ECMAScript® 2027 Language Specification # sec-string.prototype.concat |
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.