JanetDocsI'm feeling luckyGithub sign in

apply



    function

    (apply f & args)
    
    Applies a function to a variable number of arguments. Each element in
    args is used as an argument to f, except the last element in args,
    which is expected to be an array-like. Each element in this last
    argument is then also pushed as an argument to f. For example:
    
      (apply + 1000 (range 10))
    
    sums the first 10 integers and 1000.


1 exampleSign in to add an example
Loading...
(apply * [1 2 3])     # -> 6
(* (splice [1 2 3]))  # -> 6
(* ;[1 2 3])          # -> 6
(* 1 2 3)             # -> 6
cellularmitosis