Examples vs directions - express.js routes

expressjs

#1

In the Express.js tutorial, Codecademy keeps giving examples but then asking the student to complete a task in a different way. This is driving me nuts because I don’t have a model to follow and I also have no way of checking if I can complete the task using their example model. For example, in Routes lesson 10, this is the example:

const monsters = { '1': { name: 'cerberus', age: '4'  } };
// PUT /monsters/1?name=chimera&age=1
app.put('/monsters/:id', (req, res, next) => {
  const monsterUpdates = req.query;
  monsters[req.params.id] = monsterUpdates;
  res.send(monsters[req.params.id]);
});

But then in the directions, it says to use updateElement helper function instead.

What is the answer according to the example?