Update unescapeString.md

This commit is contained in:
atomiks
2017-12-30 00:08:55 +11:00
committed by GitHub
parent edc4376366
commit d49f536621

View File

@ -5,7 +5,7 @@ Unescapes escaped HTML characters.
Use `String.replace()` with a regex that matches the characters that need to be escaped, using a callback function to replace each escaped character instance with its associated unescaped character using a dictionary (object).
```js
const escapeHTML = str => str.replace(/[&<>'"]/g, tag => ({
const unescapeHTML = str => str.replace(/[&<>'"]/g, tag => ({
'&amp;': '&',
'&lt;': '<',
'&gt;': '>',