Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

push to object javascript

const obj = { a:1, b:2 }
const add = { c:3, d:4, e: ['x','y','z'] }

Object.entries(add).forEach(([key,value]) => { obj[key] = value })
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #push #object #javascript
ADD COMMENT
Topic
Name
3+2 =