top | item 43188905

(no title)

remolueoend | 1 year ago

'any' has always been intended as an escape hatch, so no abuse here [1]. The type representing the set of all possible values (the top type in the type lattice) is 'unknown'.

[1] https://www.typescriptlang.org/docs/handbook/2/everyday-type...

[2] https://www.typescriptlang.org/docs/handbook/release-notes/t...

discuss

order

epolanski|1 year ago

unknown is not equivalent to any as a type constraint: doesn't work.

https://www.totaltypescript.com/any-considered-harmful#type-...