#does var not work inside of a .then
11 messages · Page 1 of 1 (latest)
then why are you redeclaring it using var inside the then
you can overwrite variables declared with let
why would i lie
let somevar = ""
somepromise().then(() => {
somevar = "something else"
})
declare it first, do not redeclare it
and declare it on the same scope or one scope higher than where you need it
Thats... not the right solution either
When you try to access somevar its still going to be empty because the .then hasnt executed yet
You need to learn how to handle promises correctly
thats very true