let [x, y, ...z] = ['a'] //"a", undefined, []
let [x, y, z] = new Set(["a", "b", "c"]) x //"a"
[x=1, y=2, z=3, o=4] = ['a', , undefined, null] //"a", 2, 3, null
var {bar, foo, baz: loc} = {foo: 'aaa', baz: 'bbb'}
bar //undefined
foo //"aaa"
loc //"bbb"
baz //ReferenceError: baz is not defined
var node = {
loc: {
start: {
line: 1,
column: 5
}
}
}
var {loc:{start:{line}}} = node
line //1
loc //ReferenceError: loc is not defined
start //ReferenceError: start is not defined
var x;
{x}={x:1} //SyntaxError: Unexpected token =
({x}={x:1}) //正确
const [a,b] = 'hello' a//h
let {length:len} = 'hello' len//5(字符串本身包含length属性)
let a = true
{b} = {a}
//Object {a: true}
[[1,2],[3,4]].map((a,b)=>a+b) //[3,7]
function({x=0,y=0}={}){
return [x,y]
}
({
needServicePwd: this.needServicePwd,
needImgCode: this.needImgCode,
needSmsCode: this.needSmsCode
} = data)
var map = new Map();
map.set('first', 'hello');
map.set('second', 'world');
for (let [key, value] of map) {
console.log(key + " is " + value);
}
const { SourceMapConsumer, SourceNode } = require("source-map");
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有