Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lodash.has

Package Overview
Dependencies
Maintainers
3
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lodash.has

The lodash method `_.has` exported as a module.

  • 4.5.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.3M
increased by3.68%
Maintainers
3
Weekly downloads
 
Created

What is lodash.has?

The lodash.has package is a method from the Lodash library, which is a popular JavaScript utility library. This specific method is used to check if a path exists as a property in a given object, which can be deeply nested. It helps in safely checking for the existence of a property without manually traversing the properties and handling errors.

What are lodash.has's main functionalities?

Check existence of a property

This feature allows you to check whether a specific path exists within an object. It returns true if the path exists, otherwise false. This is useful for avoiding errors when accessing deeply nested properties.

const _ = require('lodash.has');
const object = { 'a': { 'b': { 'c': 3 } } };
console.log(_.has(object, 'a.b.c')); // => true
console.log(_.has(object, 'a.b.c.d')); // => false

Other packages similar to lodash.has

Keywords

FAQs

Package last updated on 31 Jul 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc