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)
喜欢
let arr = ['wanjunshijie', 'wanjunshijie1', 'wanjunshijie2']
arr.map((val, index) => {
console.log(index, val...
yekong
3年前 (2021-09-07)
喜欢
let arr = ['wanjunshijie', 'wanjunshijie1', 'wanjunshijie2']
console.log(arr.map(x => 'web'))
运行结果
['...
yekong
3年前 (2021-09-07)
喜欢
some
let arr = ['wanjunshijie', 'wanjunshijie1', 'wanjunshijie2']
arr.some((val, index) => {
console.log(inde...
yekong
3年前 (2021-09-07)
喜欢
let arr = ['wanjunshijie', 'wanjunshijie1', 'wanjunshijie2']
arr.filter((val, index) => {
console.log(index, ...
yekong
3年前 (2021-09-07)
喜欢
let arr = ['wanjunshijie', 'wanjunshijie1', 'wanjunshijie2']
arr.forEach((val, index) => {
console.log(index,...
yekong
3年前 (2021-09-07)
喜欢