How to update variable globally inside setTimeout

when I run my code, my variable "leftScale" does not update with what it should be inside the setTimeout.

   leftScale = 1;
    setTimeout(() => {
       leftScale = 2;
       console.log('Check: ' + leftScale);
    }, 2000);

    console.log(leftScale); // <-- I need this to log 2 since thats what i change in my setTimeout function

I've been told it's because this is in a different environment then my other variable, but I don't know how to make this work. Any advise or assistance in this would be appreciated. Thanks :)