Use two features of TypeScript 3.7: optional chaining and nullish coalescing, to write simple code without never-ending conditionals.