2023年11月24日

如何判断一个值为对象类型

摘要: 使用typeof判断(不推荐); let a = {}; typeof a; //object let a = []; typeof a;//object let a = null; typeof a;//object 缺点是:使用typeof时,数组和null判断结果都为对象类型所以不推荐 使用i 阅读全文

posted @ 2023-11-24 10:33 久居我梦 阅读(31) 评论(0) 推荐(0) 编辑

导航