About Cacher
Web App
Download
Sign In
Sign Up
menu
Cacher is the code snippet organizer for pro developers
We empower you and your team to get more done, faster
Learn More
somascope
10/7/2018 - 2:45 PM
share
Share
add_circle_outline
Save
JavaScript Object
js-object
content_copy
file_download
Rendered
Source
Object.assign
Copy all properties of an object to another object
Object.assign(target, ...sources)
Object.assign(this.form, stepData) // copies stepData object into the this.form object
Properties in the target object will be overwritten by properties in the sources if they have the same key.
Object.keys and Object.values
Creates an arraoy of every property's key or value in the object
const fruits = {apple: 28, orange: 17, pear: 54}
Object.keys(fruits) // [“apple”, “orange”, “pear”]
Object.values(fruits) // 28, 17, 54
clear