Outlook_Addin_LLM/node_modules/has-own-prop
2024-11-29 21:36:41 +01:00
..
index.d.ts First version with simple frontend and Compose Email by AI 2024-11-29 21:36:41 +01:00
index.js First version with simple frontend and Compose Email by AI 2024-11-29 21:36:41 +01:00
license First version with simple frontend and Compose Email by AI 2024-11-29 21:36:41 +01:00
package.json First version with simple frontend and Compose Email by AI 2024-11-29 21:36:41 +01:00
readme.md First version with simple frontend and Compose Email by AI 2024-11-29 21:36:41 +01:00

has-own-prop Build Status

A safer .hasOwnProperty()

Shortcut for Object.prototype.hasOwnProperty.call(object, property).

You shouldn't use .hasOwnProperty() as it won't exist on objects created with Object.create(null) or it can have been overridden.

Install

$ npm install has-own-prop

Usage

const hasOwnProp = require('has-own-prop');

const object = Object.create(null);
object.unicorn = true;

object.hasOwnProperty('unicorn');
//=> 'TypeError: undefined is not a function'

hasOwnProp(object, 'unicorn');
//=> true