//变量解构 //返回一个数组 function example() { return [1, 2, 3] } let [a, b, c] = example() console.log([a, b, c]) //返回一个对象 function exampleClass(){ return{ foo:1, bar:2 }; } let {foo,bar} =exampleClass() console.log({foo,bar}) //遍历Map结构 var map = new Map() map.set('first','hello'); map.set('second','world'); for(let [key,value] of map){ console.log(key + " is " + value); }