AND and OR in if statement

Jonathan Barronville jonathan at belairlabs.com
Wed May 25 01:28:55 UTC 2016


No, please don't do this. While I understand why you want this, I feel like
this is unnecessary and will just introduce yet another way to write
inconsistent and confusing JavaScript code 😕.  
  
\- Jonathan  
  
—  
  
Life is a game and we’re all just high density pixels.  

On May 24 2016, at 9:15 pm, Francis Clavette
<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  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20160524/9e1fdea7/attachment.html>


More information about the es-discuss mailing list