Skip to content
f0c23f9841
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
December 5, 2023 10:21
December 5, 2023 10:21
December 5, 2023 10:21
December 5, 2023 10:21
December 5, 2023 10:21
December 5, 2023 10:21
December 5, 2023 10:21
December 5, 2023 10:21
December 5, 2023 10:21
December 5, 2023 10:21
December 5, 2023 10:21

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