Alexander Mekhonoshin (2016-08-25T14:05:08.000Z)
invntrm at gmail.com (2016-08-25T14:11:55.953Z)
// Excuse my beginner’ English I have a few (3) thoughts: 1. binary ?. If a === null: a?.b.c === undefined If a?.b === null: a?.b.c // throws exception If a?.b === null: a?.b?.c === undefined If a === 0: a?.b.c === undefined If a === '': a?.b.c === undefined If a in not defined: a?.b.c // throws exception If a === undefined but defined: a?.b.c === undefined 2. unary ?. window?.navigator?.toString() browser: "[object Navigator]" node: ReferenceError: window is not defined here i suggest syntax for exception-slient accesing globals: ?.a === hostGlobalObject?.a ?.a?.b === hostGlobalObject?.a?.b 3. groupped ?.() Syntax for the full existential chain case: .?(a.b.c) // equals with typeof a !== 'undefined' && a.b && a.b.c I use .? here too because ?:
invntrm at gmail.com (2016-08-25T14:09:23.735Z)
// Excuse my beginner’ English I have a few (3) thoughts: 1. binary ?. If a === null: a?.b.c === undefined If a?.b === null: a?.b.c // throws exception If a?.b === null: a?.b?.c === undefined If a === 0: a?.b.c === undefined If a === '': a?.b.c === undefined If a in not defined: a?.b.c // throws exception If a === undefined but defined: a?.b.c === undefined 2. unary ?. window?.navigator?.toString() browser: "[object Navigator]" node: ReferenceError: window is not defined here i suggest syntax for exception-slient accesing globals: ?.a === hostGlobalObject?.a ?.a?.b === hostGlobalObject?.a?.b 3. groupped ?.() Syntax for the full existential chain case: .?(a.b.c) // equals with typeof a !== 'undefined' && a.b && a.b.c I use .? here too because ?: