Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

object.assign in node.js

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:
ADD COMMENT
Topic
Name
2+9 =