Single var pattern – does it still make sense in ES6?

Single var pattern

Written by burczu

  • Rasmus Vermeulen

    Remember the ‘temporal dead zone’ however:

    let x = 1;
    if () {
    let y = x + 1; // error, x doesn't exist yet

    // lots of lines

    let x = 2;
    // ...
    };

    So you might still want to make sure your variables are declared at the top of the _block_, to prevent suprises