Skip to content

Refactor to use array include #898

@aciccarello

Description

@aciccarello

Minor change to make the code more readable. Array.includes is available in Node 6+ and can be used to replace the less-readable [].indexOf !== -1 or [].indexOf > -1.

In general, Array.includes is a drop in replacement but there are some slight differences in edge cases (most notably when searching for undefined).

https://dev.to/adroitcoder/includes-vs-indexof-in-javascript

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueEasier issue for first time contributors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions