Skip to content

Tag: callback

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 condition with

What is the lexical environment inside a callback function?

I keep hearing that arrow functions inherit the value of this from their Lexical Environment. Consider this example: Why is the value of this inside the arrow callback functions undefined (or in non-strict mode: window)? If the callback function is using the value of this from its lexical environment, shouldn’t the lexical environment be addEventListener? Answer When you call a

javascript module pattern from You don’t know JS

I have been reading and testing below code out for several hours now and I just can’t seem to grasp certain things. I have been stepping through chrome console basically putting break in every line I can add and have been inspecting and I am just not sure of things 1)I am just not sure of the purpose of deps