Function unescape

  • The inverse of escapethis 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.

    Parameters

    • string: string

      The string to unescape.

    Returns string

    string Returns the unescaped string.

    Since

    5.12.0

    See

    [[escape]], [[escapeRegExp]]

    Example

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