I want muliple values in my callback function
myfunction(i,function(err,result){ console.log(JSON.parse(JSON.strigify(result))); ****//i need value here..**** });
function myfunction(i,callback) {
/* my some stuff */
var callBackString= new Array();
callBackString['value1']=value1;
callBackString['value2']= value2;
callBackString['value3']= value3;
callback(null,callBackString);
};
I am returting callBackString as an array..,
Can anybody tell me how to do that
Thanks
var callBackString = {}. You are using your array like an object, so make it one. When you serialize the array withJSON.stringify()those non-array properties get lost.stringify? You omitted annthere.