Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 629 Bytes

range.md

File metadata and controls

21 lines (14 loc) · 629 Bytes

Back to reference

range(stop) or range(start, stop, step=1)

Implementation of the Python range function. Returns an array with numbers starting at start and going to the last possible value lower than stop.

if start is not supplied, it begins with 0.

if step is not supplied, it defaults to 1. step might also be negative, but then start must be higher than stop.

Examples:

let myRange = gmynd.range(10);
// myRange will be [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
let myRange = gmynd.range(5, 2, -0.5);
// myRange will be [5, 4.5, 4, 3.5, 3, 2.5]