This piece of code was submited:
var removeById = function(personId, done) {
Person.findByIdAndRemove({_id: personId}, function(err, data) {
if(err) return console.error(err);
done(null, data);
});
};
Link to the challenge:
This piece of code was submited:
var removeById = function(personId, done) {
Person.findByIdAndRemove({_id: personId}, function(err, data) {
if(err) return console.error(err);
done(null, data);
});
};
Link to the challenge:
Hello! Welcome to the forum !
Thanks for trying to help, but your solution has a bug: if there’s an error (if(err)
), the done
callback will never be called and the execution will never end.