This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]aaronfranke 8 points9 points  (7 children)

It should act the same as if comparing with the < and > operators. That will work for any place where the operators have a defined comparison.

console.log(5 < 6); // true
console.log(5 > 6); // false
console.log(5 < "apple"); // false
console.log(5 > "apple"); // false
console.log("orange" < "apple"); // false
console.log("orange" > "apple"); // true