Skip to content

Commit b79033a

Browse files
committed
Update README.
1 parent 7fef763 commit b79033a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@ var bisectDate = bisector(function(d) { return d.date; }).right;
144144
This is equivalent to specifying a comparator:
145145

146146
```js
147-
var bisectDate = bisector(function(a, b) { return a.date - b.date; }).right;
147+
var bisectDate = bisector(function(d, x) { return d.date - x; }).right;
148148
```
149149

150-
And then applied as `bisect(data, new Date(2011, 1, 2))`, returning an index. Use a comparator rather than an accessor if you want values to be sorted in an order different than natural order, such as in descending rather than ascending order.
150+
And then applied as `bisect(data, new Date(2011, 1, 2))`, returning an index. Note that the comparator is always passed the search value *x* as the second argument. Use a comparator rather than an accessor if you want values to be sorted in an order different than natural order, such as in descending rather than ascending order.
151151

152152
<a name="shuffle" href="#shuffle">#</a> <b>shuffle</b>(<i>array</i>[, <i>lo</i>[, <i>hi</i>]])
153153

0 commit comments

Comments
 (0)