JS中String与string的区别

String是构造函数,而"string"是变量的一种类型

typeof String     // "function"
typeof string     // "undefined"
typeof "string"   // "string"


String('xxx')  返回的是一个字符串。

posted on 2018-02-28 10:34  木杉彬彬彬  阅读(4511)  评论(0编辑  收藏  举报