JSFiddle - React, Tailwind, and code Playground

JavaScript

// 声明变量
let a = 1
let b = 2
let tmp

// 交换
tmp = a
a = b
b = tmp

// 输出
console.log(a, b)