node.js - result is not coming in a call back function -
i have following code
parsebookmark(user_id, category_ids,bookmark_url,function(err, result) { console.log("parse rersult " +json.stringify(result)); //output undefined here }); function parsebookmark(user_id, category_ids,bookmark_url,callback) { savebookmark(user_id,category_ids,title,bookmark_url,function(err, result) { //result coming here callback(result); }); }
why output coming undefined here. suggestion please.
thanks
change savebookmark
call to:
savebookmark(user_id,category_ids,title,bookmark_url,function(err, result) { callback(err, result); });
if understand code correctly console log second time err
variable, undefined
.
Comments
Post a Comment