3 ms·
Here’s how I think about it, in much looser terms: unknown = I don’t know any = I don’t care Often the implications are the same, but as you can intuit, any
by bigyikes 4y ago
Here’s how I think about it, in much looser terms:
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.