JavaScript program to swap two variables using a temporary variable
We created a temp variable to store the value of a temporarily.
We assigned the value of b to a.
The value of temp is assigned to b
As a result, the value of the variables are swapped.