1 /** 2 * @fileOverview This file contains generics for String methods 3 */ 4 5 (function fn(method) { 6 if(method in String) return fn; 7 String[method] = function(arr) { 8 return String.prototype[method].apply(arr, Array.slice(arguments, 1)); 9 }; 10 return fn; 11 })('split')('explode') 12 ('repeat')('expand'); 13 14