Guest User

Untitled

a guest
Oct 19th, 2018
97
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.     push: Array.prototype.push,
  14.     splice: [].splice
  15.   }
  16.  
  17.   perky.trick.init.prototype = perky.trick;
  18.  
  19.   window.perky = perky;
  20.  
  21. })(window);
  22.  
  23. $(function(){
  24.   var x = perky();
  25.   x.push('value');
  26.   console.log(x);
  27.   console.log(x.length);
  28.   console.log(x[0]);
  29. });
Add Comment
Please, Sign In to add comment