When running a function with a callback in a loop, I am debating between using an anonymous function or a named function. Take a look at the code snippets below:
Anonymous function
for(let i=0;i<50;i++){
example_func(param1,param2,()=>{
});
}
Named function
for(let i=0;i<50;i++){
example_func(param1,param2,callback);
}
function callback(){
}
Which approach is preferable? Will using a named function result in better performance compared to an anonymous function, or does it not make much of a difference?