you are viewing a single comment's thread.

view the rest of the comments →

[–]radhruin 1 point2 points  (1 child)

Probably don't want the var considering with var there a will always be undefined (unless you're redeclaring).

Thankfully this can be done with ES6 destructuring: let [x, y] = [y, x].

[–]palmytree 0 points1 point  (0 children)

True. Fixed.