🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@stdlib/assert-has-own-property

Package Overview
Dependencies
Maintainers
4
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stdlib/assert-has-own-property

Test if an object has a specified property.

0.2.2
latest
Source
npm
Version published
Weekly downloads
488K
0.7%
Maintainers
4
Weekly downloads
 
Created

What is @stdlib/assert-has-own-property?

@stdlib/assert-has-own-property is a utility package that provides a function to check if an object has a specified property as its own (not inherited) property.

What are @stdlib/assert-has-own-property's main functionalities?

Check if an object has a specified own property

This feature allows you to check if a given object has a specified property as its own property. The function returns `true` if the property exists and `false` otherwise.

const hasOwnProp = require('@stdlib/assert-has-own-property');

const obj = { 'a': 1, 'b': 2 };

console.log(hasOwnProp(obj, 'a')); // true
console.log(hasOwnProp(obj, 'c')); // false

Other packages similar to @stdlib/assert-has-own-property

Keywords

stdlib

FAQs

Package last updated on 27 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts