Skip to content

Chapter 4: Collections #20

@sbromberger

Description

@sbromberger
Existence of a particular value

To find out whether an array has a particular value among its elements, you can use in():

    julia> in(2, primes)
    true
Somewhat strangely, in the in() syntax, the needle comes before the haystack, i.e. in(value, array), where value denotes the value you are looking for.

Why not talk about contains() as well, where the haystack comes first?

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