Swapping 2 Variables without using a third one.(Coding Std: Javascript)
var a=1;
var b=6;
a=a+b; // i.e. a=7
b=a-b; // i.e. b=1
a=a-b; // i.e. a=6
document.write("a="+a +"
b="+b) ;
Programming Tips and Tricks, Best Practices, Coding Standards.Help on windows server tips & tricks, Shortcuts and much more .....
No comments:
Post a Comment