ES6 String对象属性Length
ES6 String对象属性Length
返回字符串的长度
语法
string.length
例子
var uname = new String("Hello World") console.log(uname) console.log("Length "+uname.length) // returns the total number of characters // including whitespace
输出
Hello World Length 11