I have used the desugared version and found that what seemed obvious to me, 
that the purpose of the block was to limit the scope, was not obvious to other 
developers onĀ  my team.
If this proposal moves forward I think it should include switch and while in 
addition to if.


    On Wednesday, March 21, 2018, 11:56:08 AM CDT, Mike Samuel 
<[email protected]> wrote:  
 [...]IIUC, it sounds like the right side could be syntactic sugar for the left 
side.If that's right, what about the left side warrants new syntax to enable 
the right?

| Current | Proposed |
|   {
       let people = getTeamArray();
       if( people.length > 2 ) {
           console.log("it's a crowd", people.join(','));
       }
       else if( people.length == 2 ) {
           console.log("just a pair");
       }
       else if( people.length == 1 {
           console.log("solo");
       }
       else {
           console.log("none");
       }
  } |    if( let people = getTeamArray(); people.length > 2 ) {
       console.log("it's a crowd", people.join(','));
   }
   else if( people.length == 2 ) {
       console.log("just a pair");
   }
   else if( people.length == 1 {
       console.log("solo");
   }
   else {
       console.log("none");
   }
 |

[...]
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss
  
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to