Skip to content

Commit

Permalink
Merge pull request jashkenas#1001 from burin/sorted-index-docs
Browse files Browse the repository at this point in the history
sortedIndex documentation
  • Loading branch information
jashkenas committed Jul 6, 2013
2 parents 3a6b32f + 3764e8f commit 656dcdd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -907,10 +907,15 @@ <h2 id="arrays">Array Functions</h2>
<i>should</i> be inserted into the <b>list</b> in order to maintain the <b>list</b>'s
sorted order. If an <b>iterator</b> is passed, it will be used to compute
the sort ranking of each value, including the <b>value</b> you pass.
Iterator may also be the string name of the property to sort by (eg. <tt>length</tt>).
</p>
<pre>
_.sortedIndex([10, 20, 30, 40, 50], 35);
=&gt; 3

var stooges = [{name : 'moe', age : 40}, {name : 'larry', age : 50}, {name : 'curly', age : 60}];
_.sortedIndex(stooges, {name: 'jill', age: 55}, 'age');
=&gt; 2
</pre>

<p id="range">
Expand Down

0 comments on commit 656dcdd

Please sign in to comment.