JanetDocsSourcePlaygroundTutorialsI'm Feeling luckyCommunityGitHub sign in

accumulate2

core-api


    function
    boot.janet on line 1141, column 1

    (accumulate2 f x)

    The 2-argument version of `accumulate`. Instead of taking an 
    explicit initial value, the first value of `x` is used instead. If 
    `x` is empty, returns an empty array.

    `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...
(reduce2     + [1 2 3])  # -> 6
(accumulate2 + [1 2 3])  # -> @[1 3 6]
cellularmitosisPlayground