Home

function: last


last(array: Array): *

Gets the last element of `array`.

Example(s):

last([1, 2, 3])
// => 3

Params:

Name Type Attribute Description
array The array to query.

Returns:

*

  {
    "comment": "/**\r\n * Gets the last element of `array`.\r\n *\r\n * @since 0.1.0\r\n * @category Array\r\n * @param {Array} array The array to query.\r\n * @returns {*} Returns the last element of `array`.\r\n * @example\r\n *\r\n * last([1, 2, 3])\r\n * // => 3\r\n */",
    "meta": {
        "range": [
            237,
            362
        ],
        "filename": "last.js",
        "lineno": 13,
        "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo",
        "code": {
            "id": "astnode100005552",
            "name": "last",
            "type": "FunctionDeclaration",
            "paramnames": [
                "array"
            ]
        },
        "vars": {
            "length": "last~length"
        }
    },
    "description": "Gets the last element of `array`.",
    "since": "0.1.0",
    "tags": [
        {
            "originalTitle": "category",
            "title": "category",
            "text": "Array",
            "value": "Array"
        }
    ],
    "params": [
        {
            "type": {
                "names": [
                    "Array"
                ]
            },
            "description": "The array to query.",
            "name": "array"
        }
    ],
    "returns": [
        {
            "type": {
                "names": [
                    "*"
                ]
            },
            "description": "Returns the last element of `array`."
        }
    ],
    "examples": [
        "last([1, 2, 3])\r// => 3"
    ],
    "name": "last",
    "longname": "last",
    "kind": "function",
    "scope": "global",
    "___id": "T000002R000520",
    "___s": true,
    "filepath": "last.js"
}