I have been reading many documents here and there but I don't quite understand how the error object in javascript can be used as boolean in one place and as an object at another place.
var request = require('request'); //http wrapped module
function requestWrapper(url, callback) {
request.get(url, function (err, response) {
if (err) { //as boolean
console.log("Im here as an object "+err);
} else {
callback(null, response);
}
})
}