markdown object.assign.md

Posted

tags:

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

* Takes any number of objects as parameters and basically matches them together.
* first argument is going to be treated differently, it's going to be modified by object.assign().

```
let obj = {};
let taco = {food: 'taco'};
Object.assign(obj, taco);
console.log(obj);// Object {food: "taco"}
```
Now you can see how object.assign can be used to make copies of objects. 

A more concise way to do this would be to skip declaring Obj and create and pass it in an argument at the same tme.
```
let taco = {food:'taco'};
let tacoCopy = Object.assign({}, taco);
console.log(tacoCopy);//Object{food:"taco"}
```

```
let saucyTaco = {food: 'taco', sauce: 'hot'};
let creamyTaco = {food: 'taco', hasSourCream: true};
Object.assign(saucyTaco, creamyTaco);
console.log('saucyTaco:', saucytaco);//Object {food:"taco",sauce: "hot", hasSourCream:true}
console.log('creamyTaco:', creamyTaco);//Object {food:"taco", hasSourCream: true}
```

以上是关于markdown object.assign.md的主要内容,如果未能解决你的问题,请参考以下文章

markdown转换为图片

转换rst到markdown总结

markdown [Markdown HowTo]作为Markdown语法的秘籍

python markdown干啥用的

markdown前端渲染

如何用markdown生成目录