Skip to content

Instantly share code, notes, and snippets.

@agatablue
Last active October 24, 2017 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agatablue/c90d173f0120f3b3c806700acabca129 to your computer and use it in GitHub Desktop.
Save agatablue/c90d173f0120f3b3c806700acabca129 to your computer and use it in GitHub Desktop.
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