Skip to content

Array mutation #15

@kapcod

Description

@kapcod

#has on Array level removes item from Array, without cloning or something, it creates all sorts of unexpected issues, especially if called #has on Array by mistake.
I suggest only allowing #has on Hash scope (and #item only on Array scope) and if it's not possible, then do some cloning, in order to preserve original array when getting out of current scope.
Another idea is to make #has on Array do array.include?(arg) instead of shift the first item.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions