Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript swap

var first = 5;
var second = 7;
[first, second] = [second, first]
console.log(first, second)
//Output: 7,5
Source by dmitripavlutin.com #
 
PREVIOUS NEXT
Tagged: #javascript #swap
ADD COMMENT
Topic
Name
3+7 =