Skip to content

Instantly share code, notes, and snippets.

@agatablue agatablue/Object.assign
Last active Oct 24, 2017

What would you like to do?
var A = { name: "a" };
var B = { dev: true};
//var C = Object.assign(A,B);
// taki zapis podmieni nam obiekt A
//dlatego, że pierwszy argument to źródło kopiowania wszystkich innych
//zatem zróbmy tak:
var C = Object.assign({}, A,B); // Obiekt C wygląda tak: {name: "a", dev: true}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.