-
Notifications
You must be signed in to change notification settings - Fork 1
index
wolfram77 edited this page Mar 27, 2020
·
21 revisions
Gets zero-based index.
Similar: index, indexRange, length.
array.index(x, i);
// x: an array
// i: index (-ve: from right)
const array = require('extra-array');
var x = [2, 4, 6, 8];
array.index(x, 1);
// 1
array.index(x, -1);
// 3
array.index(x, -10);
// 0