Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more
Module

x/gutenberg/table/deps.ts>hasOwnProperty

๐Ÿ“ Complete, correct, and thoroughly tested string manipulation library.
Latest
function hasOwnProperty
import { hasOwnProperty } from "https://deno.land/x/gutenberg@0.1.5/table/deps.ts";

Determines whether an object has a property with the specified name. Avoid calling prototype builtin hasOwnProperty for two reasons:

  1. hasOwnProperty is defined on the object as something else:

    const options = { ending: 'utf8', hasOwnProperty: 'foo' }; options.hasOwnProperty('ending') // throws a TypeError

  2. The object doesn't inherit from Object.prototype:

    const options = Object.create(null); options.ending = 'utf8'; options.hasOwnProperty('ending'); // throws a TypeError

Parameters

obj: T

A Object.

v: PropertyKey

A property name.

Returns

boolean