markdown JavaScript对象

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown JavaScript对象相关的知识,希望对你有一定的参考价值。

## 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

以上是关于markdown JavaScript对象的主要内容,如果未能解决你的问题,请参考以下文章