(1)交换变量的值
[x, y] = [y, x];
(2)提取JSON数据
var jsonData = {
id: 42,
status: "OK",
data: [867, 5309]
};
let { id, status, data: number } = jsonData;
console.log(id, status, number);
标签:status,5309,number,jsonData,使用,解析,data,id,结构
来源: https://www.cnblogs.com/1024L/p/15347066.html