Dan Vanderkam
1 min readJan 24, 2019

--

Charles Maynard you can use an identity function to be more explicit about the intended type of your literal, but I’m not sure why you’d prefer that to just declaring the type:

let obj: type = literal;

--

--

Dan Vanderkam
Dan Vanderkam

Written by Dan Vanderkam

Software Developer @sidewalklabs, author of Effective TypeScript

Responses (1)