链判断运算符是一种先检查属性是否存在,再尝试访问该属性的运算符,其符号为 ?.
    如果运算符左侧的操作数 ?. 计算为 undefined 或 null,则表达式求值为 undefined 。否则,正常触发目标属性访问,方法或函数调用。
    我们来看一下官方提供的一些场景

    1. a?.b; // undefined if `a` is null/undefined, `a.b` otherwise.
    2. a == null ? undefined : a.b;
    3. a?.[x]; // undefined if `a` is null/undefined, `a[x]` otherwise.
    4. a == null ? undefined : a[x];
    5. a?.b(); // undefined if `a` is null/undefined
    6. a == null ? undefined : a.b(); // throws a TypeError if `a.b` is not a function
    7. // otherwise, evaluates to `a.b()`
    8. a?.(); // undefined if `a` is null/undefined
    9. a == null ? undefined : a(); // throws a TypeError if `a` is neither null/undefined, nor a function
    10. // invokes the function `a` otherwise

    截至目前(2018 年 12 月) 链判断运算符 还处于 stage1 阶段,TS 也暂时不支持,TS 社区也正在等待 TC39 指出链判断运算符的最终方向。