I have this if function,
if (shorturl) {
...
link.shorten({longUrl:"http://google.com"}, function(err, results) {
return results;
});
return results;
}
Now, I want the second return statement to receive the value of "results". Rather, I get "ReferenceError: results is not defined".
Help me nest the return/callback.
Reference:
I am trying to use http://github.com/nkirby/node-bitlyapi inside a function to get a shorturl