title: Explanation requested for fixedEncodeURIComponent
body: <p>I'm wondering if anyone can explain this function to me? I've tested it and it works like a dream but I don't understand how!</p>
  
  <p>It's from the MDN reference here: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent" rel="nofollow noreferrer">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent</a></p>
  
  <pre><code>function fixedEncodeURIComponent (str) {
    return encodeURIComponent(str).replace(/[!'()]/g, escape).replace(/\*/g, "%2A");
  }
  </code></pre>
  
  <p>I understand replace as the match followed by the replacement, what I am struggling with is the escape reference and the secondary replacement which results in actual encode values replacing characters e.g. ( = %28 and )= %29.</p>