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

Gets value at indices (+ve, -ve).

Alternatives: one, all, fractional.

iterable.getAll(x, is);
// x:  an iterable
// is: indices (-ve: from right)
// --> [...values]
const iterable = require('extra-iterable');

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

[...iterable.getAll(x, [-1, -2])];
// [8, 6]

references

Clone this wiki locally