Converts the characters "&", "<", ">", '"', and "'" in str to their corresponding HTML entities.
For example, "<" becomes "<".
Parameters
str: string
The string to escape.
Returns string
Returns the escaped string.
Example
escape('This is a <div> element.'); // returns 'This is a <div> element.' escape('This is a "quote"'); // returns 'This is a "quote"' escape("This is a 'quote'"); // returns 'This is a 'quote'' escape('This is a & symbol'); // returns 'This is a & symbol'
Alias