Skip to content
wolfram77 edited this page Apr 11, 2020 · 29 revisions

Gets values at indices. 🏃 📦 🌔

Alternatives: one, all, fractional.

array.getAll(x, is);
// x:  an array
// is: indices (-ve: from right)
const array = require('extra-array');

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

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

references

Clone this wiki locally