Created
March 30, 2011 08:33
-
-
Save ahmadajmi/894067 to your computer and use it in GitHub Desktop.
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
4 + 5 + 1; // return 10 | |
'4' + 5 + 1; // return '451' | |
4 + 5 + '1'; // return '91' | |
// can convert strings to numbers | |
+"45"; // return 45 | |
// also | |
Number("45"); // return 45 | |
parseInt("45", 10); // return 45 | |
+"4" + (+"5"); // return 9 | |
// Division | |
10 / 3; // return 3.3333333333333335 | |
// Equal and not Equal | |
var a = 10; | |
var b = "10"; | |
a == b; // true | |
a === b; // false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment