Skip to content
wolfram77 edited this page Mar 27, 2020 · 24 revisions

Gets length of part of array.

Similar: index, indexRange, length.

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

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

array.length(x, 1, -1);
// 2

array.length(x, 1, -10);
// 0

references

Clone this wiki locally