try this method of swapping without using a third variable
<script>
var a= 4; var b= 2;
a=a+b; b=a-b; a=a-b;
document.write("a","=",a); document.write("<br />"); document.write("b","=",b);
</script>
try this method of swapping without using a third variable
<script>
var a= 4;
var b= 2;
a=a+b;
b=a-b;
a=a-b;
document.write("a","=",a);
document.write("<br />");
document.write("b","=",b);
</script>