Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

merge two objects without spread operator

const person = {
    name: "John Doe",
    location: "Remote"
}
const job = {
    title: "Full stack developer",
    location: "Office"
}
const employee = {...person, ...job}

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