最新发布 第487页

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

js

js对象扩展运算符

js对象扩展运算符
在不确定参数个数的时候使用,即便没有值也不会报错 function ceshi(...arg) { console.log(arg[0]) console.log(arg[1]) console.log(arg[2]) console.log(ar...

yekong 4年前 (2021-09-06) 喜欢

js

js字符串结构赋值

js字符串结构赋值
let [a, b, c, d, e, f] = 'wanjun' console.log(a) console.log(b) console.log(c) console.log(d) console.log(e) console.log(f) 执行结果 ...

yekong 4年前 (2021-09-06) 喜欢

js

js结构赋值设置默认值

js结构赋值设置默认值
当解构赋值时没有值会设置一个默认值 let [a = 'false'] = [] console.log(a) 编译成es5的结果 var _ref = [], _ref$ = _ref[0], a = _ref$ === undefined ?...

yekong 4年前 (2021-09-06) 喜欢