/ Published in: JavaScript
Expand |
Embed | Plain Text
Object.extend = function(object, extend){ for(propety in extend)object[propety]=extend[propety]; }; /* Example */ Object.extend(String.prototype, { camelCase : function(){return this.replace(/-(.)/gi,function(a1,a2){return a2.toUpperCase();});}, share : function(a1){var ret=[];for(var x=0;x<this.length;x+=a1){ret.push(this.slice(x,x+a1));};return ret;} });
You need to login to post a comment.
