Skip to content

Instantly share code, notes, and snippets.

@vitalets
Last active April 5, 2017 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vitalets/1993994bd31077c775f83d7773a3566a to your computer and use it in GitHub Desktop.
Save vitalets/1993994bd31077c775f83d7773a3566a to your computer and use it in GitHub Desktop.
// 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