object.assign dans express

const newId= tours[tours.length-1].id+1;
const newTour= Object.assign({id:newId},req.body) //object.assign() is used to merge two objects.
Shirshak kandel