AddEventListener

8 years ago
User agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
Test name Executions per second
addEvenListener 0.6 Ops/sec
.on 26.5 Ops/sec
Tests:
  • addEvenListener

    AخA
     
    for (i=0; i<10000;i++) {
       document.addEventListener('click', ()=>{})
    }
  • .on

     
    for (i=0; i<10000;i++) {
    $('document').on('click', function(){})}
Open this result on MeasureThat.net