Say I have a code-snippet:
dict = {"key":"elem"}
for (var elem in dict){
someFunction(function(){
anotherFunction(dict[elem]);
})
}
Is elem
still that temporary variable created in the for...in...
statement when it is referenced at that third level, i.e. at anotherFunction(dict[elem])
?
When it gets called in my code, I get an error saying that it returns undefined.
EDIT: could I somehow fix this with a this
keyword somewhere?