Deconstructing es6 to reverse an array

can you help me write a small demo to implement the example above

Mar.23,2021

x=1,y=2
[x,y]=[y,x]
console.log(x) //2
console.log(y) //1 

I didn't add a semicolon. No wonder I can't do it all the time

.
Menu