服务器

Array

Collection

Date

Function

Lang

Math

Number

Object

Seq

String

Util

Properties

Methods

_.assignIn(object, sources)

这个方法就像_.assign它遍历自己的和继承的源属性。

注意:此方法发生变化object

版本

4.0.0

别名

_.extend

参数
  1. object (对象):目标对象。
  2. [sources] (...对象):源对象。
返回

(对象):返回object

function Foo() {
  this.a = 1;
}
 

function Bar() {
  this.c = 3;
}
 
Foo.prototype.b = 2;
Bar.prototype.d = 4;
 
_.assignIn({ 'a': 0 }, new Foo, new Bar);
// => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }