Skip to content

Ch.3 Linked Lists indexOf #37

Closed
Closed
@mangotrader

Description

@mangotrader

Hello Loiane, I think there's a small bug in the indexOf function in page 112 in the 2nd edition book.

let index = -1 should be let index = 0, so that in the while loop later, when the element is found, the function returns the correct index. Otherwise the function will return -1 if the first element is found.

What would you think?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions