朽木自雕XD

导航

js中的数据类型检测方案

一、typeof优点:能够快速区分基本数据类型缺点:不能将Object、Array和Null区分, 都返回object 二、.instanceof 优点:能够区分Array、Object和Function, 适合用于判断自定义的类实例对象 缺点: Number, Boolean, String基本数

posted on 2022-05-13 11:59  朽木自雕XD  阅读(17)  评论(0编辑  收藏  举报