JanetDocsPlaygroundI'm feeling luckyGitHub sign in
# repeat is about _side-effects_, since it returns nil. # You'll need to use a mutable collection if you want to # use repeat to add repeated items to a collection: (var coll @["Y" "Z"]) #=> @["Y" "Z"] (repeat 3 (array/push coll "A")) #=> nil coll # Returns: @["Y" "Z" "A" "A" "A"] # You can use map if the whole collection consists # of these repetitions: (map (fn [_] "A") (range 3)) # Returns: @["A" "A" "A"]