Last active
April 5, 2017 16:45
-
-
Save vitalets/1993994bd31077c775f83d7773a3566a 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
// before: | |
if (x === y) { ... } | |
// after: | |
if (strictEqual(x, y)) { ... } | |
function strictEqual(a, b) { | |
if (typeof a !== typeof b) { | |
console.warn('Strict compare of different types: ' + (typeof a) + ' === ' + (typeof b)); | |
} | |
return a === b; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment