摘要:
一、基本用法 1、Object.assign方法用于对象的合并,将源对象(source)的所有可枚举属性,复制到目标对象(target) const target = { a: 1 };const source1 = { b: 2 };const source2 = { c: 3 }; Object 阅读全文
posted @ 2021-03-17 14:59
sct春天
阅读(613)
评论(0)
推荐(0)
摘要:
1、意义不同:undefined表示变量已经声明,但是没有值;null表示空 2、数据类型不同:typeof undefined = undefined,但是typeof null=object 3、转换结果不同:undefined转数值为NaN,null转数值为0 4、产生的场景:变量被声明了但没 阅读全文
posted @ 2021-03-17 14:37
sct春天
阅读(3478)
评论(0)
推荐(0)
摘要:
一、for in for in循环是最基础的遍历对象的方式,它还会得到对象原型链上的属性 const person=Object.create({ // sex和height是原型链上的属性 sex:'male', height:168});//name和age是属于对象的属性person.name 阅读全文
posted @ 2021-03-17 14:21
sct春天
阅读(12074)
评论(0)
推荐(0)

浙公网安备 33010602011771号