How to return from the inner callback, in the below scenario, a json data is being return, when i try to do console.log it print the [Function] instead of json value
exports.tests = function(tagName, out) {
model.findbyTag(tagName, function(data) {
var json = {
"name" : 'java',
"data" : "SomeData"
}
return json;
});
}
console.log(this.tests)
it output
[Function]
What wrong i'm doing so that when this method execute it should return the json data