Jump to content

"..well Dim should be used not Local/Global, because JavaScript only has var"


Recommended Posts

Posted

Gotcha! Not anymore that let and const have been added to ES2015. So yeah, ES2015 is a step in the right direction.

function main() {
    let name = 'guiness';
    for (let i = 0; i < 10; i++) {
        let concat = name + i; // This is scoped only to the loop block
        console.log(concat);
    }
    // concat is not seen here, like it would if var was used.
}

 

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...