In ES6, do for loops with a let/const initializer create a separate scope?

Michael Zhou zhoumotongxue008 at
Mon Jun 16 11:29:34 PDT 2014

Thanks for the clarification, one detail about the order between 
incrementing and setting $$lastIteration_i:

    let i = $$lastIteration_i;   //create and initialize per iteration i
    if (!(i<10)) break;
       let i;
*    i++;
    $$lastIteration_i = i;*

Should it be*
$$lastIteration_i = i;

*instead, given what the spec says?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list