This method is like `lastIndexOf` except that it performs a binary search on a sorted `array`.
sortedLastIndexOf([4, 5, 5, 5, 6], 5)
// => 3
Name | Type | Attribute | Description |
---|---|---|---|
array | The array to inspect. | ||
value | The value to search for. |
{ "comment": "/**\r\n * This method is like `lastIndexOf` except that it performs a binary\r\n * search on a sorted `array`.\r\n *\r\n * @since 4.0.0\r\n * @category Array\r\n * @param {Array} array The array to inspect.\r\n * @param {*} value The value to search for.\r\n * @returns {number} Returns the index of the matched value, else `-1`.\r\n * @example\r\n *\r\n * sortedLastIndexOf([4, 5, 5, 5, 6], 5)\r\n * // => 3\r\n */", "meta": { "range": [ 481, 734 ], "filename": "sortedLastIndexOf.js", "lineno": 18, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo", "code": { "id": "astnode100008560", "name": "sortedLastIndexOf", "type": "FunctionDeclaration", "paramnames": [ "array", "value" ] }, "vars": { "length": "sortedLastIndexOf~length", "index": "sortedLastIndexOf~index" } }, "description": "This method is like `lastIndexOf` except that it performs a binary\rsearch on a sorted `array`.", "since": "4.0.0", "tags": [ { "originalTitle": "category", "title": "category", "text": "Array", "value": "Array" } ], "params": [ { "type": { "names": [ "Array" ] }, "description": "The array to inspect.", "name": "array" }, { "type": { "names": [ "*" ] }, "description": "The value to search for.", "name": "value" } ], "returns": [ { "type": { "names": [ "number" ] }, "description": "Returns the index of the matched value, else `-1`." } ], "examples": [ "sortedLastIndexOf([4, 5, 5, 5, 6], 5)\r// => 3" ], "name": "sortedLastIndexOf", "longname": "sortedLastIndexOf", "kind": "function", "scope": "global", "___id": "T000002R000784", "___s": true, "filepath": "sortedLastIndexOf.js" }