In my code :
var Helper = require('./helper.js');
var helper = new Helper();
var Crawler = function(){
var me = this;
this.getListCategory = function(){
var listCategory = helper.categoryInMenu(1, function(err, result){
console.log(result); //1. display command : object
return result;
});
console.log(listCategory); //2. display command : undefined
}
}
module.exports = Crawler;
At 1 : display command is object.
At 2 : display command is undefined.
Why my variable listCategory
is undefined
?
How to : do listCategory
is result
of helper.categoryInMenu
at 2
?