nil will return 0 here so this check is sufficient enough
refactor to use indexOfObjectPassingTest:
simpler terary expression
initialize property and remove extra braces