You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

lodash.includes

Package Overview
Dependencies
Maintainers
3
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lodash.includes

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


Version published
Maintainers
3
Created

Package description

What is lodash.includes?

The lodash.includes package is a utility library that provides a method to check if a value is present in a collection (array, string, or object). It is a part of the larger Lodash library, which is known for its utility functions for common programming tasks.

What are lodash.includes's main functionalities?

Check if a value is in an array

This feature allows you to check if a specific value is present in an array. In the example, it checks if the number 3 is in the array [1, 2, 3, 4].

const includes = require('lodash.includes');
const array = [1, 2, 3, 4];
const result = includes(array, 3);
console.log(result); // true

Check if a value is in a string

This feature allows you to check if a substring is present in a string. In the example, it checks if the substring 'world' is in the string 'hello world'.

const includes = require('lodash.includes');
const string = 'hello world';
const result = includes(string, 'world');
console.log(result); // true

Check if a value is in an object

This feature allows you to check if a value is present in an object. In the example, it checks if the value 2 is in the object { 'a': 1, 'b': 2, 'c': 3 }.

const includes = require('lodash.includes');
const object = { 'a': 1, 'b': 2, 'c': 3 };
const result = includes(object, 2);
console.log(result); // true

Other packages similar to lodash.includes

Readme

Source

lodash.includes v4.3.0

The lodash method _.includes exported as a Node.js module.

Installation

Using npm:

$ {sudo -H} npm i -g npm
$ npm i --save lodash.includes

In Node.js:

var includes = require('lodash.includes');

See the documentation or package source for more details.

Keywords

FAQs

Package last updated on 13 Aug 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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc