-
-
Save mimnets/0a2aedc9fcc45bff380cfe848c718893 to your computer and use it in GitHub Desktop.
Do you know how to swap two variable data? I know you did try it many times! Wait how I know? Because you are I, and I am you!!!
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
var abul = 100; | |
var babul = 99; | |
console.log("Before swap abul = ", abul, "babul = ", babul); | |
var temp = abul; //The temp value is now abul's value 100. | |
abul = babul // now abul has babul's value 99. | |
babul = temp //because temp has babul's value 100. | |
console.log("After swap abul = ", abul, "babul = ",babul); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment