Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Whatever
Swap values with array destructuring
faeze
Programming language:
Whatever
2021-08-26 21:25:23
0
Q:
Swap values with array destructuring
Adam
Code:
Whatever
2021-06-29 09:29:14
let a = 1, b = 2 [a, b] = [b, a] console.log(a) // -> 2 console.log(b) // -> 1
0
Tags
array
value
values
Related
Arraylist swap calues
array map destructuring
New to Communities?
Join the community