JavaScript Cara Membedakan Acara Klik Tunggal dan Acara Klik Ganda

element.onclick = event => {
   if (event.detail === 1) {
     // it was a single click
   } else if (event.detail === 2) {
     // it was a double click
   }
};
ayaan