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.
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
7+1 =