Proposal: Boolean.parseBoolean

Dmitry Soshnikov dmitry.soshnikov at gmail.com
Sat Mar 18 16:59:40 UTC 2017


On Fri, Mar 17, 2017 at 7:42 AM Augusto Moura <augusto.borgesm at gmail.com>
wrote:

> What would be the result for `Boolean.parseBoolean('undefined')` and
> `Boolean.parseBoolean('null')`?
>

Perhaps this should be restricted to JSON-compatible "false" only. Other
possible may include "", and "0". For stricter handling "null",
"undefined", and similar strings may even throw as non-Boolean parseable.

Dmitry

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170318/0ef150eb/attachment.html>


More information about the es-discuss mailing list