Created
July 5, 2010 02:26
-
-
Save cheeaun/463940 to your computer and use it in GitHub Desktop.
JavaScript one-liner to swap two variables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// via http://twitter.com/izs/statuses/17744109574 | |
var foo = 1; | |
var bar = 2; | |
foo = [bar, bar = foo][0]; |
esco
commented
Jul 5, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment