UNPKG

@extra-array/filter-at

Version:

Keeps values at given indices only.

10 lines (9 loc) 191 B
'use strict'; function filterAt(x, is) { var X = x.length, a = []; for (var i of is) if (i >= 0 && i < X) a.push(x[i]); return a; } module.exports = filterAt;