How to interchange two values using only two variables in HTML? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to interchange two values using only two variables in HTML?

23rd Jun 2018, 8:35 PM
Lord Pharaoh
Lord Pharaoh - avatar
2 Answers
+ 8
html? i think you mean js var a=5; var b=6; a=a+b; b=a-b; a=a-b; or...using es6 [a,b]=[b,a]; also...it can be done with bitwise operators ^
23rd Jun 2018, 8:40 PM
᠌᠌Brains[Abidemi]
᠌᠌Brains[Abidemi] - avatar
+ 1
right js sry anyway tx a lot
23rd Jun 2018, 9:17 PM
Lord Pharaoh
Lord Pharaoh - avatar