Skip to content

Function: unescape()

ts
function unescape(value): string;

Unescapes common HTML entities in a string. 反转义字符串中的常见 HTML 实体。

Parameters

ParameterTypeDescription
valuestringThe source string / 源字符串

Returns

string

The unescaped string / 反转义后的字符串

Example

ts
unescape('&lt;script&gt;') // => '<script>'
unescape('&amp;') // => '&'

Since

1.2.0

Released under the MIT License.