AND and OR in if statement

Caitlin Potter caitpotter88 at gmail.com
Wed May 25 23:30:36 UTC 2016


Devils advocate: if you were to measure usage of identifiers named “and” or “or”, on the web, how substantial do you think their use would be? And even if they were used a fair bit, that hasn’t really stopped the introduction of other contextual keywords in the past.

If you really wanted to, you could find a way to make this work. But I’m not saying we need to turn JS into Python or Perl.

> On May 25, 2016, at 7:20 PM, Rick Waldron <waldron.rick at gmail.com> wrote:
> 
> This is a non-starter, as AND and OR are already valid identifiers.
> 
> On Tue, May 24, 2016 at 9:15 PM Francis Clavette <clavette.francis at gmail.com <mailto:clavette.francis at gmail.com>> wrote:
> Hi,
> I’d like to be able to use AND for && and OR for || in conditional statements in a future version of ECMAScript. It’s a feature I’ve always been wanting since transitioning from PHP. It’s also much cleaner :
> 
> if ($scope.newSourceModal.isShown() && $scope.newsource.type == "book" && (!$scope.insertingFromScan || $scope.ok))
> 
> ==============
> 
> if ($scope.newSourceModal.isShown() AND $scope.newsource.type == "book" AND (!$scope.insertingFromScan OR $scope.ok))
> 
> 
> Francis
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org <mailto:es-discuss at mozilla.org>
> https://mail.mozilla.org/listinfo/es-discuss <https://mail.mozilla.org/listinfo/es-discuss>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160525/12fbb92f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160525/12fbb92f/attachment-0001.sig>


More information about the es-discuss mailing list