Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/esm/object/index.js>hasOwn

A JavaScript extension package for building strong and modern applications.
Latest
function hasOwn
import { hasOwn } from "https://deno.land/x/ayonli_jsext@v0.9.72/esm/object/index.js";

Returns true if the specified object has the indicated property as its own property. If the property is inherited, or does not exist, the function returns false.

Examples

Example 1

import { hasOwn } from "@ayonli/jsext/object";

const obj = { foo: "hello" };

console.log(hasOwn(obj, "foo")); // true
console.log(hasOwn(obj, "toString")); // false