Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

object.assign in 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.
 
PREVIOUS NEXT
Tagged: #express
ADD COMMENT
Topic
Name
7+2 =