JanetDocsPlaygroundI'm feeling luckyGitHub sign in

forv



    macro
    boot.janet on line 491, column 1

    (forv i start stop & body)

    Do a C-style for-loop for side effects. The iteration variable `i` 
    can be mutated in the loop, unlike normal `for`. Returns nil.


1 exampleSign in to add an example
Loading...
(do
  (var coll @[])
  (forv i 0 9
    (array/push coll i)
    (+= i 2))
  coll)
# => @[0 3 6]
sogaiuPlayground