Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

merge two objects without spread operator

const person = {
    name: "John Doe", 
    age: 24,
    location: "U.S.A"
}
const job = {
    title: "Full stack developer",
    location: "Remote"
}

const employee = Object.assign(person, job);

console.log(employee);
Source by stackabuse.com #
 
PREVIOUS NEXT
Tagged: #merge #objects #spread #operator
ADD COMMENT
Topic
Name
1+1 =