Amy Blankenship
Oct 16, 2023

--

In this specific case, I used T because the usage is obvious and the type isn't really important. Also, people using the function will only need to know that type if they're using let instead of const (so they declare the return type independently of its usage). When it's important, of course use descriptive type names. But using ArgumentType here is just unnecessary typing.

--

--

Amy Blankenship
Amy Blankenship

Written by Amy Blankenship

Full Stack developer at fintech company. I mainly write about React, Javascript, Typescript, and testing.

Responses (1)