TypeScript 3.7 adds support for optional chaining. This lesson shows you how to use it in your code to handle properties that can be null or undefined.
interface A { b?: B; } interface B { c: string; } const a: A = {}; console.log(a.b?.c);
TypeScript 3.7 adds support for optional chaining. This lesson shows you how to use it in your code to handle properties that can be null or undefined.
interface A { b?: B; } interface B { c: string; } const a: A = {}; console.log(a.b?.c);
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。