I\'m handling both the click and dblclick event on a DOM element. Each one carries out a different command, but I find that when double clicking on the element, in addition
const toggle = () => { watchDouble += 1; setTimeout(()=>{ if (watchDouble === 2) { console.log('double' + watchDouble) } else if (watchDouble === 1) { console.log("signle" + watchDouble) } watchDouble = 0 },200); }