Skip to main content
Module

x/lodash_es/mod.ts>indexOf

lodash for deno use
Latest
function indexOf
import { indexOf } from "https://deno.land/x/lodash_es@v0.0.2/mod.ts";

Gets the index at which the first occurrence of value is found in array using SameValueZero for equality comparisons. If fromIndex is negative, it's used as the offset from the end of array.

Examples

_.indexOf([1, 2, 1, 2], 2); // => 1

// Search from the fromIndex. _.indexOf([1, 2, 1, 2], 2, 2); // => 3

Parameters

array

The array to inspect.

value

The value to search for.

fromIndex