jPaq Docs - Array.range()

Quick Stats

Target Platforms:  PC (JScript) and the web (JavaScript)
Download Count:  773

Summary

Creates an array from the specified range of numbers.

Parameters

  1. start => Number
    If the "stop" parameter is given, this is the first number that may appear in the array. If the "stop" parameter is omitted, this value will be assigned to "stop" while zero will be assigned to this parameter.
  2. [stop] => Number
    Optional. If "step" is positive, the last element is the largest number where "start + i * step" is less than stop; if step is negative, the last element is the smallest number where "start + i * step" is greater than stop. If omitted, this will default to the value of "start".
  3. [step] => Number
    Optional. The difference between one element and the next. If omitted and "start" is less than "stop", this will default to 1. If omitted and "stop" is less than "start", this will default to 1.

Returns

Array
Returns an array from the specified range of numbers.

Related Examples

  1. Counting Squares On A Checker Board
    How many squares are there on a checker board?  Most people would say there are only 64 squares, but others would say what about…