Guest User

Untitled

a guest
Oct 19th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function(){
  2.  
  3.   var perky;
  4.  
  5.   perky = function(selector, context) {
  6.     return new perky.trick.init(selector, context);
  7.   };
  8.  
  9.   perky.trick = perky.prototype = {
  10.     init: function(selector, context) {
  11.       return this;
  12.     },
  13.     length: 0,
  14.     push: Array.prototype.push,
  15.     sort: [].sort,
  16.     splice: [].splice    
  17.   }
  18.  
  19.   perky.trick.init.prototype = perky.trick;
  20.  
  21.   window.perky = perky;
  22.  
  23. })(window);
  24.  
  25. $(function(){
  26.   var x = perky();
  27.   x.push('value');
  28.   console.log(x.length);
  29.   console.log(x[0]);
  30. });
Add Comment
Please, Sign In to add comment