JanetDocsI'm feeling luckyGithub sign in

array/concat



    cfunction

    (array/concat arr & parts)
    
    Concatenates a variadic number of arrays (and tuples) into the first
    argument which must an array. If any of the parts are arrays or tuples,
    their elements will be inserted into the array. Otherwise, each part in
    parts will be appended to arr in order. Return the modified array arr.


2 examplesSign in to add an example
Loading...
(def a @[1 2])
(def b @[1 2])
(= a b)  # => false

(def a @[1 2])
(def b (array/concat a 3))
a        # => @[1 2 3]
b        # => @[1 2 3]
(= a b)  # => true
cellularmitosis
(def a @[1 2])
(array/concat a 3 [4 5] @[6 7] [] @[] 8)
a  # => @[1 2 3 4 5 6 7 8]
cellularmitosis