Skip to content

Instantly share code, notes, and snippets.

@housecricket
Created August 15, 2020 10:12
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 housecricket/b8259bcda8ed1ca537d313577a1baec0 to your computer and use it in GitHub Desktop.
Save housecricket/b8259bcda8ed1ca537d313577a1baec0 to your computer and use it in GitHub Desktop.
// ✗ avoid
if (obj.prop) { .. }
if (obj.prop !== undefined) { ... }
// ✓ ok
if (Object.prototype.hasOwnProperty.call(obj, 'prop')) { ... }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment