Home

function: sortedLastIndexBy


sortedLastIndexBy(array: Array, value: *, iteratee: function): number

This method is like `sortedLastIndex` except that it accepts `iteratee` which is invoked for `value` and each element of `array` to compute their sort ranking. The iteratee is invoked with one argument: (value).

Example(s):

const objects = [{ 'n': 4 }, { 'n': 5 }]

sortedLastIndexBy(objects, { 'n': 4 }, ({ n }) => n)
// => 1

Params:

Name Type Attribute Description
array The sorted array to inspect.
value The value to evaluate.
iteratee The iteratee invoked per element.

Returns:

number

  {
    "comment": "/**\r\n * This method is like `sortedLastIndex` except that it accepts `iteratee`\r\n * which is invoked for `value` and each element of `array` to compute their\r\n * sort ranking. The iteratee is invoked with one argument: (value).\r\n *\r\n * @since 4.0.0\r\n * @category Array\r\n * @param {Array} array The sorted array to inspect.\r\n * @param {*} value The value to evaluate.\r\n * @param {Function} iteratee The iteratee invoked per element.\r\n * @returns {number} Returns the index at which `value` should be inserted\r\n *  into `array`.\r\n * @example\r\n *\r\n * const objects = [{ 'n': 4 }, { 'n': 5 }]\r\n *\r\n * sortedLastIndexBy(objects, { 'n': 4 }, ({ n }) => n)\r\n * // => 1\r\n */",
    "meta": {
        "range": [
            736,
            849
        ],
        "filename": "sortedLastIndexBy.js",
        "lineno": 22,
        "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo",
        "code": {
            "id": "astnode100008536",
            "name": "sortedLastIndexBy",
            "type": "FunctionDeclaration",
            "paramnames": [
                "array",
                "value",
                "iteratee"
            ]
        }
    },
    "description": "This method is like `sortedLastIndex` except that it accepts `iteratee`\rwhich is invoked for `value` and each element of `array` to compute their\rsort ranking. The iteratee is invoked with one argument: (value).",
    "since": "4.0.0",
    "tags": [
        {
            "originalTitle": "category",
            "title": "category",
            "text": "Array",
            "value": "Array"
        }
    ],
    "params": [
        {
            "type": {
                "names": [
                    "Array"
                ]
            },
            "description": "The sorted array to inspect.",
            "name": "array"
        },
        {
            "type": {
                "names": [
                    "*"
                ]
            },
            "description": "The value to evaluate.",
            "name": "value"
        },
        {
            "type": {
                "names": [
                    "function"
                ]
            },
            "description": "The iteratee invoked per element.",
            "name": "iteratee"
        }
    ],
    "returns": [
        {
            "type": {
                "names": [
                    "number"
                ]
            },
            "description": "Returns the index at which `value` should be inserted\r into `array`."
        }
    ],
    "examples": [
        "const objects = [{ 'n': 4 }, { 'n': 5 }]\r\rsortedLastIndexBy(objects, { 'n': 4 }, ({ n }) => n)\r// => 1"
    ],
    "name": "sortedLastIndexBy",
    "longname": "sortedLastIndexBy",
    "kind": "function",
    "scope": "global",
    "___id": "T000002R000782",
    "___s": true,
    "filepath": "sortedLastIndexBy.js"
}