When I do this:
var resetButton = document.querySelector('.resetButton');
resetButton?.onclick = function() {
//...
};
I got error: Uncaught SyntaxError: invalid assignment left-hand side.
I would like to be able to use optional chaining on every object.
??=. Wrap the outer objects in something like((foo ??= {}).bar ??= {}).baz ??= qux.?.expression evaluates tonull, then should the right-hand-side expression still be evaluated... or not? I suspect that's the reason why it isn't supported (because if the right-hand-side has side-effects but the left-hand-side isnullthen that's probably a bug, so probably better to avoid that situation entirely).?.operator sometime around 2019-2020: developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/…