String.concat() 會將兩個或多個字串連接成一個新字串。
var str1 = 'Hello'; var str2 = ' world'; str1.concat(str2);
這個方法不會修改原字串,而是回傳合併後的新字串。
簡單串接也可使用加號運算子。