How to swap two variables in JavaScript by IT Nursery I have this two variables: var a = 1, b = 2; My question is how to swap them? Only this variables, not any objects. 22 Answers 22