mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 23:57:49 +00:00
Update sortedIndex method doc examples. [ci skip]
This commit is contained in:
28
lodash.js
28
lodash.js
@@ -7205,9 +7205,6 @@
|
||||
*
|
||||
* _.sortedIndex([30, 50], 40);
|
||||
* // => 1
|
||||
*
|
||||
* _.sortedIndex([4, 5], 4);
|
||||
* // => 0
|
||||
*/
|
||||
function sortedIndex(array, value) {
|
||||
return baseSortedIndex(array, value);
|
||||
@@ -7230,13 +7227,13 @@
|
||||
* into `array`.
|
||||
* @example
|
||||
*
|
||||
* var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 };
|
||||
* var objects = [{ 'x': 4 }, { 'x': 5 }];
|
||||
*
|
||||
* _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict));
|
||||
* // => 1
|
||||
* _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
|
||||
* // => 0
|
||||
*
|
||||
* // The `_.property` iteratee shorthand.
|
||||
* _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
|
||||
* _.sortedIndexBy(objects, { 'x': 4 }, 'x');
|
||||
* // => 0
|
||||
*/
|
||||
function sortedIndexBy(array, value, iteratee) {
|
||||
@@ -7256,8 +7253,8 @@
|
||||
* @returns {number} Returns the index of the matched value, else `-1`.
|
||||
* @example
|
||||
*
|
||||
* _.sortedIndexOf([1, 1, 2, 2], 2);
|
||||
* // => 2
|
||||
* _.sortedIndexOf([4, 5, 5, 5, 6], 5);
|
||||
* // => 1
|
||||
*/
|
||||
function sortedIndexOf(array, value) {
|
||||
var length = array ? array.length : 0;
|
||||
@@ -7285,8 +7282,8 @@
|
||||
* into `array`.
|
||||
* @example
|
||||
*
|
||||
* _.sortedLastIndex([4, 5], 4);
|
||||
* // => 1
|
||||
* _.sortedLastIndex([4, 5, 5, 5, 6], 5);
|
||||
* // => 4
|
||||
*/
|
||||
function sortedLastIndex(array, value) {
|
||||
return baseSortedIndex(array, value, true);
|
||||
@@ -7309,8 +7306,13 @@
|
||||
* into `array`.
|
||||
* @example
|
||||
*
|
||||
* var objects = [{ 'x': 4 }, { 'x': 5 }];
|
||||
*
|
||||
* _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
|
||||
* // => 1
|
||||
*
|
||||
* // The `_.property` iteratee shorthand.
|
||||
* _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
|
||||
* _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
|
||||
* // => 1
|
||||
*/
|
||||
function sortedLastIndexBy(array, value, iteratee) {
|
||||
@@ -7330,7 +7332,7 @@
|
||||
* @returns {number} Returns the index of the matched value, else `-1`.
|
||||
* @example
|
||||
*
|
||||
* _.sortedLastIndexOf([1, 1, 2, 2], 2);
|
||||
* _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
|
||||
* // => 3
|
||||
*/
|
||||
function sortedLastIndexOf(array, value) {
|
||||
|
||||
Reference in New Issue
Block a user