hasown

A robust, ES3 compatible, "has own property" predicate.

  • hasown

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
hasown
112.0.22 months ago10 years agoMinified + gzip package size for hasown in KB

Readme

!github actionsactions-imageactions-url !coveragecodecov-imagecodecov-url !Licenselicense-imagelicense-url !Downloadsdownloads-imagedownloads-url
!npm badgenpm-badge-pngpackage-url
A robust, ES3 compatible, "has own property" predicate.

Example

const assert = require('assert');
const hasOwn = require('hasown');

assert.equal(hasOwn({}, 'toString'), false);
assert.equal(hasOwn([], 'length'), true);
assert.equal(hasOwn({ a: 42 }, 'a'), true);

Tests

Simply clone the repo, npm install, and run npm test