- 博客(2)
- 收藏
- 关注
原创 数据类型检测
是因为使用typeOf检测null时,检测结果是对象,因为null和object在计算机中都是以000开的二进制存储,所以检测结果是对象。四种方式:typeof、instanceof、constructor、object.prototype.toString.call([value])适合基本数据类型的检测:除null的基本数据类型(string、number、boolean、undefined)instanceof不能检测基本数据类型,但是!typeof不能区分普通对象、数组对象、正则对象、日期对象等。
2024-10-11 15:34:49
332
原创 数组的方法(改变原数组和不改变原数组)
常见:map、forEach、concat、join、slice、filter、some、every、includes、find、findLast、indexOf、lastIndexOf、from、of、toReversed、toSorted、with等。(4)与改变原数组中作用相同但不改变原数组的方法toSpliced(操作数组)、toReversed(反转)、toSorted(排序)(3)数组中是否包含某个值some、every、includes (返回值true、false),at(读到的元素)
2024-10-11 14:46:03
613
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人