Created
April 2, 2018 07:47
-
-
Save msteckyefantis/f20dbef07493a664ed9a8acd2f346957 to your computer and use it in GitHub Desktop.
Swapping the Values of Two Variables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
let a = 2; // a is now 2 | |
let b = 3; // b is now 3 | |
let c = a; | |
a = b; | |
b = c; | |
// a is now 3, and b is 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment