Skip to content

Commit

Permalink
Fixes jashkenas#1159. Document that 'negative' ranges are zero-length.
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Jul 25, 2013
1 parent 4b36875 commit 71099af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,9 @@ <h2 id="arrays">Array Functions</h2>
<tt>each</tt> and <tt>map</tt> loops. <b>start</b>, if omitted, defaults
to <i>0</i>; <b>step</b> defaults to <i>1</i>. Returns a list of integers
from <b>start</b> to <b>stop</b>, incremented (or decremented) by <b>step</b>,
exclusive.
exclusive. Note that ranges that <b>stop</b> before they <b>start</b>
are considered to be zero-length instead of negative — if you'd like a
negative range, use a negative <b>step</b>.
</p>
<pre>
_.range(10);
Expand Down

0 comments on commit 71099af

Please sign in to comment.