title: The following code "à = &agrave; = ", eval("&"+a+"grave"+";") ] does not yield à = &agrave; = à
body: <p>See the compile version below, it seems to work more or less fine, but I would like to obtain the same translated results (apart from the line breaks) output to the console.</p>
  
  <pre><code>&lt;div id="did"&gt;&lt;/div&gt;
      let tmp="",
      ast = `${"*".repeat(5)}`,
      chr = new Array( "","a","c","e","ae","æ","oe","œ","i","o","u","y","A","C","E","AE","Æ","OE","Œ","I","O","U","Y","Ð")
      let len=chr.length,
      sp= new Array( "acute","grave","cedil","circ",
      "lig","rdm","slash","tilde","uml"
      for(let m=0, spl=sp.length ; m&lt;spl ; m++) {
          tmp += `${ast}
          ${sp[m].toUpperCase()} ${ast}
          &lt;br&gt;&lt;br&gt;`;
          for(let k=0;k&lt;len;k++) {
              let s = `&amp;amp;${chr[k]}${sp[m]};` ;
              let t= `&amp;${chr[k]}${sp[m]};`;
              tmp+=`[ ${chr[k]} ] =&gt; ${s} ${ast}
              « &amp;${chr[k]}${sp[m]}; »`;
              //if(t.slice(1)===s.slice(5)) tmp+=` ${".".repeat(3)}`;
              tmp+=`&lt;br&gt;`;
          }
          tmp=`${tmp}&lt;br&gt;&lt;br&gt;`;
      }
      document.getElementById(`did`).innerHTML=tmp;
      console.log(tmp);
  </code></pre>
  
  <p>It yields this at the body element :</p>
  
  <pre><code>[ ] =&gt; &amp;acute; ***** « ´ »
  [ a ] =&gt; &amp;aacute; ***** « á »
  [ c ] =&gt; &amp;cacute; ***** « c »
  [ e ] =&gt; &amp;eacute; ***** « é »
  [ ae ] =&gt; &amp;aeacute; ***** « &amp;aeacute; »
  </code></pre>
  
  <p>...</p>
  
  <p>And this at the console :</p>
  
  <pre><code>[  ] =&gt; &amp;amp;acute; ***** « &amp;acute; »
  [ a ] =&gt; &amp;amp;aacute; ***** « &amp;aacute; »
  [ c ] =&gt; &amp;amp;cacute; ***** « &amp;cacute; »
  [ e ] =&gt; &amp;amp;eacute; ***** « &amp;eacute; »
  </code></pre>
  
  <p>Many thanks.</p>