I think you could just use the native indexOf here - `envIds.indexOf(env.id)` - same for the else if after this one.