Skip to content

Conversation

ankitkumar748846
Copy link
Contributor

Fixes: #212

Description:

  • Added an initial value to .reduce() to prevent errors.
  • Added a check for an empty DIRECTIONS array to return null safely.
  • Ensured cleaner and more reliable code execution.

@aaronbrethorst
Copy link
Member

I think we have bigger problems if DIRECTIONS is somehow empty.

@coveralls
Copy link

Coverage Status

coverage: 15.682% (-0.02%) from 15.701%
when pulling 2a3a34a on ankitkumar748846:reduce
into 0d64bc9 on OneBusAway:main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Best Practice: Add Initial Value to reduce() to Improve Robustness
3 participants