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

Get values at indices.

Alternatives: get, getAll, getPath.
Similar: get, set, remove.


function getAll(x, is)
// x:  an array
// is: indices
const xarray = require('extra-array');

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

xarray.getAll(x, [1, 3]);
// → [ 4, 8 ]


References

Clone this wiki locally