DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR JAVASCRIPT
Swap values with array destructuring
let a = 1, b = 2 [a, b] = [b, a] console.log(a) // -> 2 console.log(b) // -> 1
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#Swap
#values
#array
#destructuring
ADD COMMENT
Topic
COMMENT
Name
2+9 =
Submit