Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

swap two numbers without temp in javascript

let a = 5, b = 6;
[a, b] = [b, a];

// Destructuring Assignment Array Matching
 
PREVIOUS NEXT
Tagged: #swap #numbers #temp #javascript
ADD COMMENT
Topic
Name
2+5 =