daily pastebin goal
8%
SHARE
TWEET

Untitled

a guest Jul 23rd, 2018 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var _addProps = function(a, name)
  2. {
  3.   a[name + '.a'] = name + '.a';  
  4.   a['d'] = name + '.d';
  5. };
  6.  
  7. var _create = function(proto)
  8. {
  9.   var C = function(){};
  10.   C.prototype = proto;
  11.   return new C();
  12. };
  13.  
  14. _addProps(Object.prototype, 'Object.prototype');
  15. var a0 = {}
  16. _addProps(a0, 'a0');
  17. var a1 = _create(a0);
  18. _addProps(a1, 'a1');
  19. var a2 = _create(a1);
  20. _addProps(a2, 'a2');
  21.  
  22. var t = '';
  23. for(var i in a2)
  24. {
  25.   t += a2[i] + '\n';
  26. }
  27.  
  28. console.log(t);
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