Create an Array with the New Order:
The expression [b, a] creates a new array with b as the first element and a as the second.
[b, a] = [10, 5] (when a = 5 and b = 10).
Destructure the Array:
The array on the right-hand side ([b, a]) is unpacked into the variables on the left-hand side ([a, b]).
a gets the value of b (10).
b gets the value of a (5).
#softwareengineer #javascript #reactnative #react #nodejs #android #ios
#alrt #treding #swap