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

236
Views
Is there any reason *NOT* to define a MutationObserver callback using an arrow function?

I'm learning to drink the ES6 koolaid ...

I've read that there are contexts where using a ES6 "arrow function" is not a good idea. I think the main one where the "this" variable is expected, like in methods. Is there a problem using an arrow function to define a callback; specifically for a Mutation Observer, like this:

var observer = new MutationObserver(mutations => {
      mutations.forEach(mutation => {
         // do stuff...
       });
   });

This works in Chrome. Haven't tried other browsers.

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!