All examples for type predictions I found are for simple cases when I'm returning information about passed argument. Is it possible for myCache.has(x) and myCache.get(x) scenario?
We don't have this on Map as well (this gives the same warning), I think I'm reaching too high...
const storage: Map<string, string> = new Map();
if (storage.has('test')) {
storage.get('test').toUpperCase();
}
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.