hasown
A robust, ES3 compatible, "has own property" predicate.
Last updated 6 months ago by ljharb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install hasown 
SYNC missed versions from official npm registry.

hasown Version Badge

github actions coverage License Downloads

npm badge

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

Current Tags

  • 2.0.4                                ...           latest (6 months ago)

6 Versions

  • 2.0.4                                ...           6 months ago
  • 2.0.3                                ...           7 months ago
  • 2.0.2                                ...           3 years ago
  • 2.0.1                                ...           3 years ago
  • 2.0.0                                ...           3 years ago
  • 1.0.1                                ...           12 years ago

© 2010 - cnpmjs.org x YWFE | Home | YWFE