JanetDocsPlaygroundI'm feeling luckyGitHub sign in

range



    function
    boot.janet on line 990, column 1

    (range & args)

    Create an array of values [start, end) with a given step. With one 
    argument returns a range [0, end). With two arguments, returns a 
    range [start, end). With three, returns a range with optional step 
    size.


1 exampleSign in to add an example
Loading...
(range 12) # => @[0 1 2 3 4 5 6 7 8 9 10 11]

(range 0 12) # => @[0 1 2 3 4 5 6 7 8 9 10 11]

(range 0 12 1) # => @[0 1 2 3 4 5 6 7 8 9 10 11]

(range 0 12 2) # => @[0 2 4 6 8 10]

(range 0 12 3) # => @[0 3 6 9]

(range 0 12 4) # => @[0 4 8]

(range 0 12 6) # => @[0 6]
jgartePlayground