TypeScript tip: Avoid specifying a type inside map


TypeScript tip: Avoid specifying a type inside map.

The array's type automatically applies to the map function.

Here's why the redundant type is a problem:

A redundant type infers that the array isn't typed. So every time I see a redundant type in the map call, I need to inspect the array itself to assure it has a type.

View original on X