Home

function: unescape


unescape(string: string): string

The inverse of `escape`this method converts the HTML entities `&`, `<`, `>`, `"` and `'` in `string` to their corresponding characters. **Note:** No other HTML entities are unescaped. To unescape additional HTML entities use a third-party library like [_he_](https://mths.be/he).

Example(s):

unescape('fred, barney, & pebbles')
// => 'fred, barney, & pebbles'

Params:

Name Type Attribute Description
string The string to unescape.

Returns:

string

  {
    "comment": "/**\r\n * The inverse of `escape`this method converts the HTML entities\r\n * `&`, `<`, `>`, `"` and `'` in `string` to\r\n * their corresponding characters.\r\n *\r\n * **Note:** No other HTML entities are unescaped. To unescape additional\r\n * HTML entities use a third-party library like [_he_](https://mths.be/he).\r\n *\r\n * @since 0.6.0\r\n * @category String\r\n * @param {string} [string=''] The string to unescape.\r\n * @returns {string} Returns the unescaped string.\r\n * @see escape, escapeRegExp\r\n * @example\r\n *\r\n * unescape('fred, barney, & pebbles')\r\n * // => 'fred, barney, & pebbles'\r\n */",
    "meta": {
        "range": [
            937,
            1105
        ],
        "filename": "unescape.js",
        "lineno": 32,
        "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo",
        "code": {
            "id": "astnode100011046",
            "name": "unescape",
            "type": "FunctionDeclaration",
            "paramnames": [
                "string"
            ]
        },
        "vars": {
            "": null
        }
    },
    "description": "The inverse of `escape`this method converts the HTML entities\r`&`, `<`, `>`, `"` and `'` in `string` to\rtheir corresponding characters.\r\r**Note:** No other HTML entities are unescaped. To unescape additional\rHTML entities use a third-party library like [_he_](https://mths.be/he).",
    "since": "0.6.0",
    "tags": [
        {
            "originalTitle": "category",
            "title": "category",
            "text": "String",
            "value": "String"
        }
    ],
    "params": [
        {
            "type": {
                "names": [
                    "string"
                ]
            },
            "optional": true,
            "defaultvalue": "''",
            "description": "The string to unescape.",
            "name": "string"
        }
    ],
    "returns": [
        {
            "type": {
                "names": [
                    "string"
                ]
            },
            "description": "Returns the unescaped string."
        }
    ],
    "see": [
        "escape, escapeRegExp"
    ],
    "examples": [
        "unescape('fred, barney, & pebbles')\r// => 'fred, barney, & pebbles'"
    ],
    "name": "unescape",
    "longname": "unescape",
    "kind": "function",
    "scope": "global",
    "___id": "T000002R001005",
    "___s": true,
    "filepath": "unescape.js"
}