SOURCE

let a =1,b =2;
function swap(a,b){
    // return [a,b] = [b,a]
    b=b-a;
    a=a+b;
    b=a-b;
    console.log(a,b)
    return [a,b]
}
swap(a,b);
console 命令行工具 X clear

                    
>
console