You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
alert(`${guest} ${admin}`); // Pete Jane (successfully swapped!)
136
136
```
137
137
138
-
The trick is that `a` and `b` values are assigned to a new array, from which `a` and `b` take their new values.
139
-
This is much easier than using a temporary value to store a value until one of the variables is assigned the new value, then assign the temporary value to the other variable.
138
+
Here we create a temporary array of two variables and immediately destructure it in swapped order.
0 commit comments