面试题整理
js 篇
1.js 数据类型
原始类型和对象类型. 原: number,string,boolean,null,undefined; 对: object,function,regexp;
2. 类型转换
强制类型转换 parseInt(),parseFloat(),
隐式类型转换 四则运算
转换为字符串 toString()
3. 数据类型检测
- alert(typeof null);
- alert(typeof undefined);
- alert(typeof "abc")
- alert(typeof 123)
4. 变量的作用域和变量提升
5.typeof 和 instanceof 的区别
typeof 是检测操作数类型
instanceof 是测试对象类
6. 继续整理中
来源: http://www.qdfuns.com/note/48855/8907d31c8a75aa105c60874e4143131d.html