| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/String/concat | [Back] [Original] |
Get to know MDN better
const str1 = "Hello";
const str2 = "World";
console.log(str1.concat(" ", str2));
// : "Hello World"
console.log(str2.concat(", ", str1));
// : "World, Hello"
concat(str1)
concat(str1, str2)
concat(str1, str2, /* , */ strN)
str1, , strNstr 1 String.prototype.concat() Array.prototype.concat()
concat()
const hello = "";
console.log(hello.concat("", ""));
// Hello, Kevin. Have a nice day.
const greetList = ["", " ", "", "!"];
"".concat(...greetList); // " !"
"".concat({}); // "[object Object]"
"".concat([]); // ""
"".concat(null); // "null"
"".concat(true); // "true"
"".concat(4, 5); // "45"
| ECMAScript 2027 LanguageSpecification # sec-string.prototype.concat |
Stringanchor()at()big()blink()bold()charAt()charCodeAt()codePointAt()concat()endsWith()fixed()fontcolor()fontsize()includes()indexOf()isWellFormed()italics()lastIndexOf()link()localeCompare()match()matchAll()normalize()padEnd()padStart()repeat()replace()replaceAll()search()slice()small()split()startsWith()strike()sub()substr()substring()sup()toLocaleLowerCase()toLocaleUpperCase()toLowerCase()toString()toUpperCase()toWellFormed()trim()trimEnd()trimStart()valueOf()[Symbol.iterator]()Object/Function| Web Proxy Viewer | New URL | Original Page |