TDD javascript - filter valid emails from arrays