Skip to content

Instantly share code, notes, and snippets.

@tutubalin
Last active January 31, 2020 09:51
Show Gist options
  • Save tutubalin/e6a30fd25a7deca7342b8d2ff870ce29 to your computer and use it in GitHub Desktop.
Save tutubalin/e6a30fd25a7deca7342b8d2ff870ce29 to your computer and use it in GitHub Desktop.
JavaScript inconsistency
console.log(('10'-'9') === (10-9)); // true
console.log(('10'*'9') === (10*9)); // true
console.log(('10'/'9') === (10/9)); // true
console.log(('10'&'9') === (10&9)); // true
console.log(('10'|'9') === (10|9)); // true
console.log(('10'^'9') === (10^9)); // true
console.log(('10'**'9') === (10**9)); // true
console.log(('10'<<'9') === (10<<9)); // true
console.log(('10'>>'1') === (10>>1)); // true
console.log(('10'+'9') === (10+9)); // false
console.log(('10'>'9') === (10>9)); // false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment