Checking String vs boolean in filter before calling indexOf.