1.基本类型和引用类型
基本类型: string,number,boolean
引用类型:object ,array
2.手写深拷贝
function deepClone(obj) { if(typeof obj !== 'object'){ return obj } let result if(obj instanceof Array){ result = [] }else { result = {} } for (let key in obj) { if(obj.hasOwnProperty(key)){ result[key] = deepClone(obj[key]) } } return result }
3.什么情况下会发生强制值类型转化
(1)字符串拼接
(2)==
(3)if判断
(4)逻辑运算