你的位置:首页 > 软件开发 > Java > 数据类型及数据类型的检测

数据类型及数据类型的检测

发布时间:2016-03-31 23:33:41
基本数据类型number string boolean underfined null;引用数据类型Object Array RegExp; typeof 检测数据类型 但是不能检测(对象、数组、正则)instanceof/construc ...

 

基本数据类型

number  string  boolean  underfined  null;

引用数据类型

Object  Array  RegExp;

 


typeof 检测数据类型 但是不能检测(对象、数组、正则)

instanceof/constructor检测某一个实例是否属于一个类;

我们的constructor可以避免instanceof检测的时候,用Object也是true的问题;

console.log([].constructor === Object);//->false 

 

海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com

原标题:数据类型及数据类型的检测

关键词:数据类型

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。