title: Javascript Audio doesn't play for first 3 Clicks and plays from 4th click without any issues, what could be wrong?
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(".btn").click(function(event){
        playSound(event.target.id);
  });
  
  function playSound(name){
    $("." + name).click(function() {
    new Audio("sounds/" + name + ".mp3").play();
  
  });
  }</code></pre>
  </div>
  </div>
  </p>
  <p>Function gets called but audio doesn't play for first 3 or 4 clicks and from 4th or 5th clicks onwards it just works alright, what could be wrong, i tested in Brave and Chrome, same issue in both browsers.</p>