Instantly share code, notes, and snippets.

Embed
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