Skip to content

Instantly share code, notes, and snippets.

@alenvlahovljak
Last active September 3, 2020 11:24
Show Gist options
  • Save alenvlahovljak/53a4a705ec19dec771cee07ef6db4d33 to your computer and use it in GitHub Desktop.
Save alenvlahovljak/53a4a705ec19dec771cee07ef6db4d33 to your computer and use it in GitHub Desktop.
How to handle comparison corner cases?
var arr1 = [];
var arr2 = [];
//1. arr1 == !arr2
//2. [] == false
//3. "" == false
//4. "" == 0
//5. 0 == 0
//6. 0 === 0
if (true) console.log("Yes, it's true!");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment