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刪除。