Created
May 14, 2014 21:11
-
-
Save carlosrojaso/ee9ee82fe6b1798b6db3 to your computer and use it in GitHub Desktop.
JS Comparison operators
This file contains hidden or 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
// Comparison operators | |
var foo = 1; | |
var bar = 0; | |
var baz = "1"; | |
var bim = 2; | |
foo == bar; // false | |
foo != bar; // true | |
foo == baz; // true; but note that the types are different | |
foo === baz; // false | |
foo !== baz; // true | |
foo === parseInt( baz ); // true | |
foo > bim; // false | |
bim > baz; // true | |
foo <= baz; // true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment