Unescape apostrophe (') in JavaScript?
问题 I'm trying to unescape a HTML-escaped apostrophe ( "'" ) in JavaScript, but the following doesn't seem to work on a devtools console line: unescape('''); The output is simply: "'" It doesn't work in Underscore's unescape either: _.unescape(''') What am I doing wrong? 回答1: unescape has nothing to do with HTML character entities. It's an old, deprecated function for decoding text encoded with escape , which is an old, deprecated function for encoding text in a way that is unlikely to be useful