最新发布 第5页

完竣世界-关注前端分享心得

js

js WeakSet

js WeakSet
不允许重复值 let weakObj = new WeakSet() let obj = {a: 'wanjunshijie', b: 'wanjunshijie.com'} weakObj.add(obj) console.log(weakObj...

yekong 1周前 (09-07) 47℃ 0喜欢

js

js 对象元素保护

js 对象元素保护
let a = Symbol(); let obj = { [a]: 'wanjunshijie' } console.log(obj[a]) obj[a] = 'web' console.log(obj[a]) let a = Symb...

yekong 1周前 (09-07) 40℃ 0喜欢

js

js 合并对象

js 合并对象
Object.assign let a = {a: 'wanjunshijie'} let b = {b: '完俊世界'} let c = {c: 'web'} let d = Object.assign(a, b, c) cons...

yekong 1周前 (09-07) 38℃ 0喜欢

js

js ===和Object.js的区别?

js ===和Object.js的区别?
===同值相等 Object.js严格相等 console.log(+0===-0) //true console.log(NaN===NaN) //false console.log(Object.is(+0,-0)) //false console.log(Object.i...

yekong 1周前 (09-07) 46℃ 0喜欢

js

es6 数组替换

es6 数组替换
let arr = ['wanjunshijie', 'wanjunshijie1', 'wanjunshijie2'] console.log(arr.map(x => 'web')) 运行结果 ['...

yekong 1周前 (09-07) 41℃ 0喜欢