Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on A 'CSS reset' for TypeScript, improving types for common JavaScript API's. Parent comment
unknown = I don’t know
any = I don’t care
Often the implications are the same, but as you can intuit, any is a lot more relaxed.
Any will work anywhere because you just don’t care what the type is.
Unknown is stricter. It won’t work in cases where other types expect you to know what type you’re dealing with.
The compiler treats unknown very cautiously, whereas you can slap an any on pretty much anything.
There are no comments on this comment yet.
unknown = I don’t know
any = I don’t care
Often the implications are the same, but as you can intuit, any is a lot more relaxed.
Any will work anywhere because you just don’t care what the type is.
Unknown is stricter. It won’t work in cases where other types expect you to know what type you’re dealing with.
The compiler treats unknown very cautiously, whereas you can slap an any on pretty much anything.