SHARE
TWEET

Untitled

a guest May 22nd, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Object Literal ile nesne içinde nesne (nested objects)
  2.  
  3. const o1 = {
  4.   w: 'lorem ipsum',
  5.   x: 42,
  6.   y: 3.14,
  7.   g: function () { },
  8.   h: function () { },
  9.  
  10.   // inner object
  11.   ox: {
  12.     z: 99,
  13.     j: function () { }
  14.   }
  15. };
  16.  
  17. // o1 nesnesini kopyalayıp o2 nesnesi oluştur
  18. const o2 = Object.assign({}, o1);
  19.  
  20. // o2 nesnesini kullanıma hazırla
  21. o2.w = 'dolor sit';
  22. o2.x = 45;
  23. o2.y = 2.71;
  24. o2.ox.z = 333; //bu daha başlangıç :)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top