Last active
August 29, 2015 14:12
-
-
Save r01010010/bf90002f209481493b3e to your computer and use it in GitHub Desktop.
Calling a defined in file var from a callback... undefined!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('another_file.js'); | |
var whatever = 8; | |
function foo(){ | |
// calling a function from another file | |
foo_with_callback(function(returned_value){ | |
console.log(whatever) // whatever is undefined <--- WHY ??? | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment