Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

swap in javascript

var first = 5;
var second = 7;
[first, second] = [second, first];
console.log(first, second);
//answer - 7 5
 
PREVIOUS NEXT
Tagged: #swap #javascript
ADD COMMENT
Topic
Name
1+7 =