Skip to content

Instantly share code, notes, and snippets.

@chrisinajar
Forked from anonymous/gist:2510889
Created April 27, 2012 17:20
Show Gist options
  • Save chrisinajar/2510984 to your computer and use it in GitHub Desktop.
Save chrisinajar/2510984 to your computer and use it in GitHub Desktop.
Issue with defining variable. first console logs correct result, second one shows unmodified variable
app.get('/canvas', function(req,res) {
database.activegalleries(function(results){
for (gallery in results){
var name = results[gallery]['gallery_name'];
database.viewgallery(name, function(imgs){
results[gallery]['imgs']=imgs;
console.log(results[gallery])
});
}
console.log(results);
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment