Checks whether value is in a collection. Arrays and objects use SameValueZero equality; strings are checked for a substring. Optional fromIndex starts the search later (negative counts from the end). Part of Lodash 4.x Collection.
Pass the required arguments shown below. Lodash Collection helpers usually return a new value — check whether the source is mutated.
Syntax
Call _.includes on a collection. Start with this line.
Lodash
_.includes(collection, value, [fromIndex=0])
Call
What it does
_.includes(collection, value, [fromIndex=0])
Primary signature.
_.includes(collection)
Call with a collection argument.
Prefer import includes from "lodash/includes" when you want a smaller bundle.
Library declarations
Lodash
_.includes(collection, value, [fromIndex=0])
Parameters
Parameter
Description
collection
Required. Array, object, or string to inspect
value
Required. Element / value / substring to find
fromIndex
Optional. Start index; default 0; negative from end
indexOf. Uses strict equality; NaN === NaN is false → -1.
Tip. Prefer includes when NaN may appear.
Compatibility
Browser & Runtime Support
_.includes is a Lodash 4.x Collection helper. It runs anywhere Lodash runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install lodash. Native Array.prototype.includes / String.prototype.includes are ES2016 and array/string only.
✓ Stable · Lodash 4.x
_.includes()
Available in [email protected] full builds and the lodash/includes modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.
100%With Lodash 4.x
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
_.includesLodash 4.x+
Bottom line: Safe for production once Lodash is loaded. Prefer import includes from "lodash/includes" for smaller builds. Use Lodash when you need one API for arrays, objects, and strings.
Frequently Asked Questions
_.includes(collection, value, fromIndex) returns true if value is found. Arrays and objects use SameValueZero equality. Strings are checked for a substring.
No. It only reads the collection and returns a boolean.
For array-like collections it is where the search starts (default 0). A negative fromIndex counts from the end.
No. On plain objects it searches enumerable values, not key names.
Yes. SameValueZero treats NaN as equal to NaN — like Array.prototype.includes.
includes returns a boolean and supports NaN. indexOf returns a numeric index (or -1) and uses strict equality for NaN (never finds it).