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

2.10.19 • Public • Published

Gets index range of part of array. 📦 😺 🏃 📼 🌔 📜 📰 📘

Similar: index, indexRange, size, isEmpty.

This is part of package extra-array.


array.indexRange(x, [i], [I]);
// x: an array
// i: start index (-ve: from right) (0)
// I: end index (-ve: from right) (X)
// → [start index, end index]
const array = require("extra-array");

var x = [2, 4, 6, 8];
array.indexRange(x, 1);
// [1, 4]

array.indexRange(x, 1, -1);
// [1, 3]

array.indexRange(x, 1, -10);
// [1, 1]


References

Package Sidebar

Install

npm i @extra-array/index-range

Weekly Downloads

6

Version

2.10.19

License

MIT

Unpacked Size

4.36 kB

Total Files

8

Last publish

Collaborators

  • wolfram77