Closed ArneBab closed 4 years ago
Is there a similarly easy advice to add support for the ?? as for private fields (https://github.com/mooz/js2-mode/issues/537)?
It is currently stage 4: https://github.com/tc39/proposal-nullish-coalescing
Short form:
const response = { settings: { nullValue: null, height: 400, animationDuration: 0, headerText: '', showSplashScreen: false } }; const undefinedValue = response.settings.undefinedValue ?? 'some other default'; // result: 'some other default' const nullValue = response.settings.nullValue ?? 'some other default'; // result: 'some other default' const headerText = response.settings.headerText ?? 'Hello, world!'; // result: '' const animationDuration = response.settings.animationDuration ?? 300; // result: 0 const showSplashScreen = response.settings.showSplashScreen ?? true; // result: false```
closed in favor of https://github.com/mooz/js2-mode/issues/559 (sorry)
Is there a similarly easy advice to add support for the ?? as for private fields (https://github.com/mooz/js2-mode/issues/537)?
It is currently stage 4: https://github.com/tc39/proposal-nullish-coalescing
Short form: