Home

function: without


without(array: Array, values: *): Array

Creates an array excluding all given values using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) for equality comparisons. **Note:** Unlike `pull`, this method returns a new array.

Example(s):

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

Params:

Name Type Attribute Description
array The array to inspect.
values The values to exclude.

Returns:

Array

  {
    "comment": "/**\r\n * Creates an array excluding all given values using\r\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\r\n * for equality comparisons.\r\n *\r\n * **Note:** Unlike `pull`, this method returns a new array.\r\n *\r\n * @since 0.1.0\r\n * @category Array\r\n * @param {Array} array The array to inspect.\r\n * @param {...*} [values] The values to exclude.\r\n * @returns {Array} Returns the new array of filtered values.\r\n * @see difference, union, unionBy, unionWith, xor, xorBy, xorWith\r\n * @example\r\n *\r\n * without([2, 1, 2, 3], 1, 2)\r\n * // => [3]\r\n */",
    "meta": {
        "range": [
            695,
            806
        ],
        "filename": "without.js",
        "lineno": 22,
        "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo",
        "code": {
            "id": "astnode100011630",
            "name": "without",
            "type": "FunctionDeclaration",
            "paramnames": [
                "array",
                "values"
            ]
        }
    },
    "description": "Creates an array excluding all given values using\r[`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\rfor equality comparisons.\r\r**Note:** Unlike `pull`, this method returns a new array.",
    "since": "0.1.0",
    "tags": [
        {
            "originalTitle": "category",
            "title": "category",
            "text": "Array",
            "value": "Array"
        }
    ],
    "params": [
        {
            "type": {
                "names": [
                    "Array"
                ]
            },
            "description": "The array to inspect.",
            "name": "array"
        },
        {
            "type": {
                "names": [
                    "*"
                ]
            },
            "optional": true,
            "variable": true,
            "description": "The values to exclude.",
            "name": "values"
        }
    ],
    "returns": [
        {
            "type": {
                "names": [
                    "Array"
                ]
            },
            "description": "Returns the new array of filtered values."
        }
    ],
    "see": [
        "difference, union, unionBy, unionWith, xor, xorBy, xorWith"
    ],
    "examples": [
        "without([2, 1, 2, 3], 1, 2)\r// => [3]"
    ],
    "name": "without",
    "longname": "without",
    "kind": "function",
    "scope": "global",
    "___id": "T000002R001053",
    "___s": true,
    "filepath": "without.js"
}