字符串-String
字符串中,有些特殊字符,叫做字面量,常见的字面量如下表:
判断字符串长度使用length属性
text.length; 10
字符串拼接
var a = ‘Java‘; undefined var b = ‘Script‘; undefined var c = a+b; undefined c "JavaScript"
转化为字符串
var t = 123; undefined t.toString(); "123"t.toString(2);"1111011"
时间: 2024-12-28 19:56:27