Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

swap two variables javascript

var a = 1,
    b = 2;
b = [a, a = b][0];
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #swap #variables #javascript
ADD COMMENT
Topic
Name
6+8 =