Skip to content

Commit

Permalink
Create method3.js
Browse files Browse the repository at this point in the history
  • Loading branch information
purushottam54 committed Jul 18, 2023
1 parent b8ec70f commit 698e389
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions methods/method3.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
let a = 5;
let b = 10;

console.log("Before swapping: a =", a, "b =", b);

a = a ^ b;
b = a ^ b;
a = a ^ b;

console.log("After swapping: a =", a, "b =", b);

0 comments on commit 698e389

Please sign in to comment.