// find all indexes in array that match value let indices = array.map((e, i) => e === value ? i : '').filter(String)