Consider these two implementation of event handlers
Implementation 1:
on('event' namedFuction)
namedFuction(){
// do something
}
Implementation 2:
on('event', () => {
// do something
})
Assume that these will be called multiple times. I have been told implementation 1 will be more memory efficient than implementation 2, because namedFunction() will be stored in memory once and arrow function will be recalculated each time, and also we should avoid arrow functions in general. How much truth there is to it?