前端面试的话术集锦第 5 篇:高频考点( 类型转换 & 深浅拷贝 & 模块化机制等)

这是记录前端面试的话术集锦第五篇博文——高频考点(类型转换 & 深浅拷贝 & 模块化机制等),我会不断更新该博文。❗❗❗

1. typeof类型判断: typeof是否能正确判断类型? instanceof能正确判断对象的原理是什么


typeof对于原始类型来说,除了null都可以显示正确的类型:

typeof 1 // 'number'
typeof '1' // 'string'
typeof undefined // 'undefined'
typeof true // 'boolean'
typeof Symbol

猜你喜欢

转载自blog.csdn.net/lvoelife/article/details/132623834