Created
August 17, 2017 19:16
-
-
Save formatkaka/b5cdfb9cba4b33807845fb19a89d4944 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
// if both values in the < comparison are strings, | |
// the comparison is made lexicographically (aka alphabetically like | |
// a dictionary). But if one or both is not a string, | |
// then both values are coerced to be numbers, and a typical numeric | |
// comparison occurs. | |
var a = 41; | |
var b = "42"; | |
var c = "43"; | |
a < b; // true | |
b < c; // true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment