JanetDocsSourcePlaygroundI'm feeling luckyCommunityGitHub sign in

mapcat

core-api


    function
    boot.janet on line 1101, column 1

    (mapcat f ind & inds)

    Map a function `f` over every value in a data structure `ind` and 
    use `array/concat` to concatenate the results, but only if no 
    `inds` are provided. Multiple data structures can be handled if 
    each `inds` is a data structure and `f` is a function of arity one 
    more than the number of `inds`. Note that `f` is only applied to 
    values at indeces up to the largest index of the shortest of `ind` 
    and each of `inds`.


1 exampleSign in to add an example
Loading...
# Convert an array of k/v pairs into a table

(def kvp @[[:foo 1] [:bar 2]])
(table ;(mapcat identity kvp))  # => @{:foo 1 :bar 2}
MikeBellerPlayground