Skip to content

inspect-js/hasOwn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Mar 10, 2024
d00d350 · Mar 10, 2024

History

18 Commits
Mar 10, 2024
Mar 10, 2024
Oct 11, 2023
Feb 10, 2024
Oct 11, 2023
Oct 11, 2023
Mar 10, 2024
Oct 11, 2023
Oct 11, 2023
Mar 10, 2024
Feb 10, 2024
Mar 10, 2024
Mar 10, 2024

Repository files navigation

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