Home

function: isNil


isNil(value: *): boolean

Checks if `value` is `null` or `undefined`.

Example(s):

isNil(null)
// => true

isNil(void 0)
// => true

isNil(NaN)
// => false

Params:

Name Type Attribute Description
value The value to check.

Returns:

boolean

  {
    "comment": "/**\r\n * Checks if `value` is `null` or `undefined`.\r\n *\r\n * @since 4.0.0\r\n * @category Lang\r\n * @param {*} value The value to check.\r\n * @returns {boolean} Returns `true` if `value` is nullish, else `false`.\r\n * @example\r\n *\r\n * isNil(null)\r\n * // => true\r\n *\r\n * isNil(void 0)\r\n * // => true\r\n *\r\n * isNil(NaN)\r\n * // => false\r\n */",
    "meta": {
        "range": [
            334,
            384
        ],
        "filename": "isNil.js",
        "lineno": 19,
        "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo",
        "code": {
            "id": "astnode100004978",
            "name": "isNil",
            "type": "FunctionDeclaration",
            "paramnames": [
                "value"
            ]
        }
    },
    "description": "Checks if `value` is `null` or `undefined`.",
    "since": "4.0.0",
    "tags": [
        {
            "originalTitle": "category",
            "title": "category",
            "text": "Lang",
            "value": "Lang"
        }
    ],
    "params": [
        {
            "type": {
                "names": [
                    "*"
                ]
            },
            "description": "The value to check.",
            "name": "value"
        }
    ],
    "returns": [
        {
            "type": {
                "names": [
                    "boolean"
                ]
            },
            "description": "Returns `true` if `value` is nullish, else `false`."
        }
    ],
    "examples": [
        "isNil(null)\r// => true\r\risNil(void 0)\r// => true\r\risNil(NaN)\r// => false"
    ],
    "name": "isNil",
    "longname": "isNil",
    "kind": "function",
    "scope": "global",
    "___id": "T000002R000474",
    "___s": true,
    "filepath": "isNil.js"
}