2 ms·
I think any in TypeScript's context means "not in the type system", and all type rules bounce off it. So if k's type is any, and you type k.foo, it doesn't both
by seanmcdirmid 9y ago
I think any in TypeScript's context means "not in the type system", and all type rules bounce off it. So if k's type is any, and you type k.foo, it doesn't bother checking it. I assume the same applies to any null checking.
- k__ 9y agoThe "object" type is probably what I was searching.
- spiralx 9y agoThe object type is the type of all non-primitive types, what you want is the Object type instead. Yes, it's confusing, especially as there's also the {} type! This article goes over the differences: https://blog.mariusschulz.com/2017/02/24/typescript-2-2-the-object-type https://blog.mariusschulz.com/2017/02/24/typescript-2-2-the-...