title: How do I delete an element from Array with click
body: <p>I have an array and I called it in a table, now I want to make a button, if you click on this button, the last array is deleted, but it doesn't work for me</p>
  <pre class="lang-js prettyprint-override"><code>const show = document.querySelector(&quot;#show&quot;);
  const ul = document.querySelector(&quot;ul&quot;);
  const table = document.querySelector(&quot;table&quot;)
  
  var th = `
      &lt;th&gt; name&lt;/th&gt; 
      &lt;th&gt; Alter&lt;/th&gt; 
      &lt;th&gt; Beruf&lt;/th&gt; 
      &lt;th&gt;  &lt;div id=&quot;reverss&quot;&gt; Revers&lt;/div&gt;  &lt;/th&gt; `;
  
  const schule = [
  
    {
      name: &quot;Sam &quot;,
      Alter: &quot;80&quot;,
      Beruf: &quot;Mediengestalter&quot;
    },
    {
      name: &quot;Alm&quot;,
      Alter: &quot;26&quot;,
      Beruf: &quot;PTA&quot;
    },
    {
      name: &quot;Chris&quot;,
      Alter: &quot;18&quot;,
      Beruf: &quot;AZUBI&quot;
    },
    {
      name: &quot;Smith&quot;,
      Alter: &quot;4&quot;,
      Beruf: &quot;OKA&quot;
    }
  ]
  
  table.innerHTML += th + schule.map(info =&gt;
    ` &lt;tr&gt; &lt;td&gt;   ${info.name} &lt;/td&gt; &lt;td&gt; ${info.Alter}&lt;/td&gt; &lt;td&gt; ${info.Beruf} &lt;/td&gt; &lt;/tr&gt; &lt;br&gt;`
  
  )
  
  const rever = document.querySelector(&quot;#reverss&quot;).addEventListener(&quot;click&quot;, samee);
  
  function samee() {
  
    schule.pop();
  }
  </code></pre>