I was watching a NodeJS Interactive talk and the guy speaking was saying how anonymous functions were bad one of the reasons being that if they have no name, the VM cannot optimize the function based on how frequently it's used because its nameless.
So if a function with a name is called
random.Async('Blah', function randomFunc() {});
randomFunc
can be optimized as where a function like:
random.Async('Blah', function(cb) {});
This will not be optimized because it's anonymous, nameless.
So I was wondering if arrow functions would do the same thing because I don't think you can name arrow functions.
Will
random.Async('Blah', (cb) => {});
be optimized?
Edit: Looking for link to the talk where the guy mentions this, will report back. (This talk was from a while ago and its just something I remembered from it)
Edit Found the video: https://youtu.be/_0W_822Dijg?t=299
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…