关于assign( )方法,用于将所有可枚举的属性的值从一个或多个源对象复制到目标对象,它将返回目标对象。
在考虑对象复制时,用assign( )方法,将源对象属性拷贝到目标对象, 创建一个新的对象,在空对象上做操作,可以避免直接赋值后,对象之间的相互影响。
var toolTipOption = assign({}, {x: 1}, opts.extra.tooltip);