Skip to content

surprising behaviour of map.contains #186

@divarvel

Description

@divarvel

The behaviour of map.contains is a bit surprising / inconsistent with .get

  • .get() errors when called with something else than a string or int, whereas contains just returns false
  • .contains() works with keys, not values (the equivalent behaviour on values can be recovered with .any())

This is part of the spec now, but we might want to revisit that in a future major version with breaking changes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions