JanetDocsSourcePlaygroundTutorialsI'm Feeling luckyCommunityGitHub sign in

has-value?

core-api


    function
    boot.janet on line 1490, column 1

    (has-value? x value)

    Checks if `x` contains `value`.

    `x` can be a bytes, indexed, dictionary, fiber, or abstract type 
    with suitable `get` and `next` methods.


1 exampleSign in to add an example
Loading...
(defn array-difference [array-1 array-2]
  (filter |(not (has-value? array-2 $)) array-1))

(array-difference [1 2 3 4 5] [2 3 4]) # => @[1 5]
veqqqPlayground