
javascript基础
haotone
探恒创
展开
-
js 数据类型
类型,即值的内部特征,它定义了值的行为,以使其区别于其他值。 javascript七种内置类型: 空值:(null); 未定义:(undefined); 布尔值:(boolean); 数字:(number); 字符串:(string); 对象:(object); 符号:(symbol); 现在使用typeof查看值的类型: typeof undefined === "undef原创 2017-04-13 16:05:24 · 242 阅读 · 0 评论 -
js 值和类型
javascript中变量没有类型,只有值有类型。变量可以随时持有任何类型的值。 var a = 42; typeof a;//"number" a = true; typeof a;//"boolean" typeof typeof 45;//"string"变量在未持有值的时候为undefined,即typeof 返回 “undefined”。 var a; typeof a;//"u原创 2017-04-13 19:47:33 · 339 阅读 · 0 评论