Object. Assign is not compatible with IE9, so write your own Object. Attach to Object.prototype, use Typeof Object.assign! = ‘function
var assign = function(params) {
if(! params) { throw new TypeError('Assign requires an argument! ');
}
var newTarge = new Object();
for (var index = 0; index < arguments.length; index++) {
var source = arguments[index];
if (source! = null) {for (var key in source) {
if(! newTarge.hasOwnProperty(key)) { newTarge[key] =source[key]; }}}}return newTarge;
};
Copy the code