title: What is the HtmlSpecialChars equivalent in JavaScript?
body: <p>Apparently, this is harder to find than I thought it would be. And it even is so simple...</p>
  <p>Is there a function equivalent to PHP's <a href="https://www.php.net/manual/en/function.htmlspecialchars.php" rel="noreferrer">htmlspecialchars</a> built into JavaScript? I know it's fairly easy to implement that yourself, but using a built-in function, if available, is just nicer.</p>
  <p>For those unfamiliar with PHP, htmlspecialchars translates stuff like <code>&lt;htmltag/&gt;</code> into <code>&amp;lt;htmltag/&amp;gt;</code></p>
  <p>I know that <code>escape()</code> and <code>encodeURI()</code> do not work this way.</p>