Array.prototype.map = function(f) {
for (var i = 0; i < this.length; i++) {
- this[i] = f(this[i])
+ this[i] = f(this[i]);
}
};
String.prototype.trim = function() {
- return jQuery.trim(this) // anciennement : this.replace(/^\s+|\s+$/g, "");
-}
+ return jQuery.trim(this); // anciennement : this.replace(/^\s+|\s+$/g, "");
+};
String.prototype.ltrim = function() {
return this.replace(/^\s+/, "");
-}
+};
String.prototype.rtrim = function() {
return this.replace(/\s+$/, "");
-}
-
+};
/**
* Voir : http://www.coolpage.com/developer/javascript/Correct%20OOP%20for%20Javascript.html