This will pretty much will work in any data types im assuming?
let a = 'a1'
let b = 'b1'
a = [a,b]
b = a[0]
a = a[1]
console.log(a,b) // b1,a1
a = 'a1'
b = 'b1'
a = [a,b]
b = a[0]
a = a[1]
print(a,b) # b1,a1
There are better ways like, destructuring, this is just an alternative