Optional Chaining (aka Existential Operator, Null Propagation)

Kevin Smith zenparsing at gmail.com
Fri Feb 5 17:50:15 UTC 2016


>
> In case `myForm.querySelector('select[name=foo]')` is not null, then
> `myForm.querySelector('select[name=foo]').selectedOptions` is always an
> HTMLCollection and has always a `length` property. If it is not the case,
> then either I made a typo, or I am testing some ancient browser that
> doesn’t support yet the `selectedOptions` property. In both cases, I want
> an exception to be thrown rather than an error to be dropped: it's easier
> to debug.
>

Makes sense, thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160205/43e41f56/attachment.html>


More information about the es-discuss mailing list