Skip to content

Instantly share code, notes, and snippets.

@lumosmind
Last active May 11, 2019 20:57
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 lumosmind/3b22fc979b4d4b0c1820ee928d229b35 to your computer and use it in GitHub Desktop.
Save lumosmind/3b22fc979b4d4b0c1820ee928d229b35 to your computer and use it in GitHub Desktop.
// Object Literal ile nesne içinde nesne (nested objects)
const o1 = {
w: 'lorem ipsum',
x: 42,
y: 3.14,
g: function () { },
h: function () { },
// inner object
ox: {
z: 99,
j: function () { }
}
};
// o1 nesnesini kopyalayıp o2 nesnesi oluştur
const o2 = Object.assign({}, o1);
// o2 nesnesini kullanıma hazırla
o2.w = 'dolor sit';
o2.x = 45;
o2.y = 2.71;
o2.ox.z = 333; //bu daha başlangıç :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment