Skip to content

Tag: scope

Reset an array and have it be mutable again

I am making tic-tac-toe from TOP, I’m not looking for someone to do my homework I just think I’m severely misunderstanding arrays, and or scope. I have a module “Game” where I store the game info It is all controlled from a controller module, that sets up the players, plays the round, …

Function parameter is not defined in callback

I am trying to get the location of the user and using that I am trying to get the city. I don’t why but when I call the query function, the city parameter is having some value but it is not reflected in the callback function’s if condition. However, if I replace the city variable in the If conditi…

How does variable setting work with await?

Can someone explain to me why this is not working the way I am expecting? I am expecting the last console.log to run after my functions run, but it is returning empty length string instead of the actual date. These are the variables I want to set after my function call. Declaring them now so the scope is set …