Tell us what’s happening:
Am stuck with this challenge I think i have done what am suppose to do but am not getting it through.
Your code so far
/** 8) Classic Update : Find, Edit then Save */
var findEditThenSave = (personId, done) => {
var foodToAdd = 'hamburger';
Person.findById(personId)
.then(person => {
person.favoriteFoods = [ ...person.fovoriteFoods, foodToAdd ];
person.save();
}).catch(err => console.log(err))
done(null/*, data*/);
};
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36
.
Link to the challenge: