Home

function: initial


initial(array: Array): Array

Gets all but the last element of `array`.

Example(s):

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

Params:

Name Type Attribute Description
array The array to query.

Returns:

Array

  {
    "comment": "/**\r\n * Gets all but 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 {Array} Returns the slice of `array`.\r\n * @example\r\n *\r\n * initial([1, 2, 3])\r\n * // => [1, 2]\r\n */",
    "meta": {
        "range": [
            302,
            429
        ],
        "filename": "initial.js",
        "lineno": 15,
        "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo",
        "code": {
            "id": "astnode100003672",
            "name": "initial",
            "type": "FunctionDeclaration",
            "paramnames": [
                "array"
            ]
        },
        "vars": {
            "length": "initial~length"
        }
    },
    "description": "Gets all but 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": [
                    "Array"
                ]
            },
            "description": "Returns the slice of `array`."
        }
    ],
    "examples": [
        "initial([1, 2, 3])\r// => [1, 2]"
    ],
    "name": "initial",
    "longname": "initial",
    "kind": "function",
    "scope": "global",
    "___id": "T000002R000378",
    "___s": true,
    "filepath": "initial.js"
}