Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

172
Views
¿Por qué la delegación de eventos en Javascript es más rápida que un evento secundario normal?

Por qué el código número uno es un código de escucha de eventos secundarios normal en js es más lento que el código número 2, el número dos es la delegación de eventos en js.

 // #1 navLink.forEach(function (item) { item.addEventListener('click', function (e) { e.preventDefault(); const navId = item.getAttribute('href'); const navEl = document.querySelector(navId); navEl.scrollIntoView({ behavior: 'smooth' }); }); }); // #2 navLinks.addEventListener('click', function (e) { e.preventDefault(); // matching strategy if (e.target.classList.contains('nav__link')) { const navId = e.target.getAttribute('href'); const navEl = document.querySelector(navId); navEl.scrollIntoView({ behavior: 'smooth' }); } });
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!