Friday, December 30, 2016

Object.assign()

The Object.assign() method is used to copy the values of all enumerable own properties from one or more source objects to a target object. It will return the target object.

var obj = { a: 1 };
var copy = Object.assign({}, obj);
console.log(copy); // { a: 1 }

@reference_1_mozilla
@reference_2_stackoverflow

No comments:

Post a Comment