function (err, doc) {
if (err)
return console.log(err);
workWith(doc);
}
比
function (err, doc) {
if (err)
console.log(err);
else
workWith(doc);
}
看起来结构性好
function (err, doc) {
if (err)
return console.log(err);
workWith(doc);
}
比
function (err, doc) {
if (err)
console.log(err);
else
workWith(doc);
}
看起来结构性好