title: Is there a single function that returns number (when called) depending on which button was clicked
body: <p>I have four buttons which i want for them to return a value: 0, 1, 2, 3 depending on the button's index clicked
  Ex.when I Click the second button
  <code>console.log(function());</code> will output 1</p>
  <p>Maybe something like this</p>
  <pre><code>click[1].addEventListener(&quot;click&quot;, jon);
  click[2].addEventListener(&quot;click&quot;, jon);
  click[3].addEventListener(&quot;click&quot;, jon);
  
  function jon(){return 0;}
  function jon(){return 1;}
  function jon(){return 2;}
  function jon(){return 3;}
  
  console.log(jon());
  </code></pre>