标签:ice ... blog 字符串拼接 语法 xbox bsp concat syntax
语法如下:
str.concat(string2[, string3, ..., stringN])
示例:
var hello = ‘Hello, ‘; console.log(hello.concat(‘Kevin‘, ‘ have a nice day.‘)); /* Hello, Kevin have a nice day. */ var greetList = [‘Hello‘, ‘ ‘, ‘Venkat‘, ‘!‘]; "".concat(...greetList); // "Hello Venkat!" "".concat({}); // [object Object] "".concat([]); /// "" "".concat(null); // "null" "".concat(true); // "true" "".concat(4, 5); // "45" "".concat({}); // [object Object]
标签:ice ... blog 字符串拼接 语法 xbox bsp concat syntax
原文地址:http://www.cnblogs.com/spring87/p/6684157.html