摘要:
typeof用来检测给定变量的数据类型(也可叫做基本类型,基本数据类型。包含undefined、boolean、string、number、object、function)var message = "so easy";alert(typeof message); //"string"alert(typeof 12); //"number"可以这样记忆:typeof是用来判断不是用new创建的“变量”。instanceof用来检测对象的类型(也可叫做引用类型。包含Object、Array、Date、RegExp、Function、基本 阅读全文