1 min readDec 6, 2016
You’ve also switched from an arrow function to a function statement here. The fairer comparison is to:
const identity = <T>(arg: T) => arg;
It’s still “noisier,” but only by a few characters vs. the untyped version.
You’ve also switched from an arrow function to a function statement here. The fairer comparison is to:
const identity = <T>(arg: T) => arg;
It’s still “noisier,” but only by a few characters vs. the untyped version.
Software Developer @sidewalklabs, author of Effective TypeScript