Skip to content
Subhajit Sahu edited this page May 3, 2023 · 20 revisions

Find the length of an array.

Similar: index, indexRange, size, isEmpty.


function length(x, i, I)
// x: an array
// i: begin ±index [0]
// I: end ±index (exclusive) [X]
const xarray = require('extra-array');

var x = [2, 4, 6, 8];
xarray.length(x);
// → 4

xarray.length(x, 1);
// → 3

xarray.length(x, 1, 3);
// → 2


References

Clone this wiki locally