onlyValues<T> static method
Returns the elements of list that are also in values.
Arr.onlyValues([1, 2, 3, 4], [2, 4, 9]); // [2, 4]
Implementation
static List<T> onlyValues<T>(Iterable<T> list, Iterable<T> values) {
final include = values.toSet();
return [
for (final v in list)
if (include.contains(v)) v,
];
}