Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript copy some properties from one object to another

const user = { _id: 1234, firstName: 'John', lastName: 'Smith' };
const { _id, ...newUser } = user;
console.log(newUser);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #copy #properties #object
ADD COMMENT
Topic
Name
4+6 =