TLDR Web Dev · ARTICLES & TUTORIALS
`ANY` CONSIDERED HARMFUL, EXCEPT FOR THESE CASES
Summary from the TLDR Web Dev newsletter
Use of the “any” type is discouraged because it disables TypeScript's safety features, making code prone to errors and harder to maintain. However, there are some cases where using “any” is the right solution. It should be used in arguments when defining generic functions that should work with any function type. "any" can also be used with type assertions to work around TypeScript's limitations to accurately model functions that return different types based on input.