let x = 1, y = 2;
[x, y] = [y, x]
console.log(x,y);
解构赋值(快速交换值)
最新推荐文章于 2023-08-09 18:21:34 发布
let x = 1, y = 2;
[x, y] = [y, x]
console.log(x,y);