本文共 334 字,大约阅读时间需要 1 分钟。
let [a,b]=[1,2]let [foo,[[bar],baz]]=[1,[[2],3]]let [ , , the] = ["foo","bar","baz"]//the = "baz"let [head, ...tail]=[1,2,3,4]//head 1//tail [2,3,4]//结构赋值允许默认值let [foo=true]=[]
for of便利Map
var map = new Map()
map. set(“a”,“name”)
for(let [key, value] of map)
输入模块的指定方法
const { SourceMapConsumer, SourceNode }= require(source-map")
转载地址:http://yvsh.baihongyu.com/