class Coder {
name(val) {
console.log(val)
return val;
}
skill(val) {
console.log(this.name('wj'...
yekong
3年前 (2021-09-07)
喜欢
constructor
class Coder {
name(val) {
console.log(val)
return val;
}
skill(val) {
console.log(this.name...
yekong
3年前 (2021-09-07)
喜欢
let pro = new Proxy({
add: function (val) {
return val + 100;
},
name: 'i am '
}, {
get: function (target, k...
yekong
3年前 (2021-09-07)
喜欢
不允许重复值
let weakObj = new WeakSet()
let obj = {a: 'wanjunshijie', b: 'wanjunshijie.com'}
weakObj.add(obj)
console.log(weakObj...
yekong
3年前 (2021-09-07)
喜欢
let setArr=new Set(['wanjunshijie','完俊世界','完俊世界','web'])
setArr.add('html')
console.log(setArr)
cons...
yekong
3年前 (2021-09-07)
喜欢
let a = Symbol();
let obj = {
[a]: 'wanjunshijie'
}
console.log(obj[a])
obj[a] = 'web'
console.log(obj[a])
let a = Symb...
yekong
3年前 (2021-09-07)
喜欢
Object.assign
let a = {a: 'wanjunshijie'}
let b = {b: '完俊世界'}
let c = {c: 'web'}
let d = Object.assign(a, b, c)
cons...
yekong
3年前 (2021-09-07)
喜欢
===同值相等
Object.js严格相等
console.log(+0===-0) //true
console.log(NaN===NaN) //false
console.log(Object.is(+0,-0)) //false
console.log(Object.i...
yekong
3年前 (2021-09-07)
喜欢
let key = 'skill'
var obj = {
[key]: 'web'
}
console.log(obj)
执行结果
...
yekong
3年前 (2021-09-07)
喜欢
for of
let arr = ['ceshi', 'wanjun', 'wanjunshijie']
for (let val of arr) {
console.log(val)
}
map
let arr = [&...
yekong
3年前 (2021-09-07)
喜欢