@extra-array/index-of
TypeScript icon, indicating that this package has built-in type declarations

2.10.19 • Public • Published

Finds first index of a value. 📦 😺 🏃 📼 🌔 📜 📰 📘

Alternatives: indexOf, lastIndexOf.
Similar: search, indexOf, isValue, includes.

This is part of package extra-array.


array.indexOf(x, v, [i]);
// x: an array
// v: search value
// i: start index (0)
const array = require("extra-array");

var x = [1, 2, 3, 2, 5];
array.indexOf(x, 2);
// 1        ^

var x = [1, 2, 3, 2, 5];
array.indexOf(x, 2, 2);
// 3              ^


References

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @extra-array/index-of

      Weekly Downloads

      12

      Version

      2.10.19

      License

      MIT

      Unpacked Size

      4.19 kB

      Total Files

      8

      Last publish

      Collaborators

      • wolfram77