Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 295 Bytes

named-closures.md

File metadata and controls

22 lines (16 loc) · 295 Bytes

Named Closures

Naming your closures will produce better stack traces, heap and cpu profiles.

JavaScript

Right:

req.on('end', function onEnd() {
  console.log('winning');
});

Wrong:

req.on('end', function() {
  console.log('losing');
});