KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
In this answer there is a simple function that will return array equality for arrays that contain primitive values. However, I'm not sure why it works. Here is the function: function arrays_equal(a,b) { return !!a && !!b && !(a<b || b<a); } I'm mostly interested in the second half; this bit: !(a<b || b<a) Why does the < and > work when comparing the arrays but the == doesn't? How do the less than and greater than methods work within JavaScript?
Tags (comma-separated)
Save Edits
Cancel