交换两个变量的值

var temp;
var a = 1;
var b = 3;
temp = a;
a = b;
b = temp;
console.log(a, b)

  

posted @ 2022-11-22 14:38  小闫的姑娘  阅读(5)  评论(0编辑  收藏  举报