var is either module scoped, if declared outside of a function, or function root scoped, regardless of where it is declared inside the function. const/let have more granular scope, so if it's defined in a loop of if block, it will not exist outside of that scope. the module scope is inaccessible from the console, so you would need to use a global scope. to do that, you'd have to append it to the global object, as in global.SOME_CONST = 5;. at that point, you would be able to access SOME_CONST in the console.