How to compare between two or more buttons in js?
<p>I have two buttons in my html code. I want to call only one js function (no jQuery) for each buttons.</p>

<p>The function will have conditions. I want to know how to compare between which button is clicked by the user.</p>

<p>Example :</p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>if (button 1 clicked) {
  block
} else {
  block
}</code></pre>
</div>
</div>
</p>

<p>The other way is to make one function per button but I don't want to do this.</p>

<p>Thank you very much.</p>