extender – string  [ 733 views ]

Goal: give some additional function to the String type

// 1. repeat n-times - '<div />'.repeat(4) -> "<div /><div /><div /><div />"
TypeExtend(String, 'repeat', function(n) { return new Array(n + 1).join(this); });

// 2. find string in other
TypeExtend(String, 'contains', function(s) { return !!~this.indexOf(s); });
#sidebar a { color:#fff; } #sidebar ul ul li { color: #DEF585; } #sidebar h2 { color: #fff; } #sidebar ul p, #sidebar ul select { color: #BEDDBE; } #backfly { background: url(images/golfBallWallPaper.jpg) left bottom fixed repeat-x #65a51d; }