In the Platformer Game, can someone explain to me in step 46 how we can reference the object “keys” before we define it? I’m not looking for the answer code to this step, I’ve got that.
The object keys
is being accessed from inside of a function. Because that function can literally be called at any point, as long as it exists during the runtime and is reachable from the scope of that, it’s perfectly valid JavaScript.
1 Like
Ahah! Thank you Aaron! Of course! And since we aren’t invoking the function animate until later, then this is fine!
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.