Here you can find the source of ucfirst()
/* Function that returns the string with the first letter as uppercase */ String.prototype.ucfirst = function () { return this.charAt(0).toUpperCase() + this.slice(1); };
String.prototype.ucFirst = function(){ result = this.replace(/^\w/g, function(x){ return x.toUpperCase(); }); return result; };
String.prototype.ucFirst = function() { return [this.charAt(0).toUpper(), this.slice(1)].join(''); };
String.prototype.ucFirst = function() { return this.charAt(0).toUpperCase() + this.slice(1);
String.prototype.ucFirst = function(){ return this.replace(/^\w/, function(x){ return x.toUpperCase(); })
String.prototype.uc_first = function() { return this.charAt(0).toUpperCase() + this.slice(1); };
String.prototype.ucfirst = function() { return this.charAt(0) + this.slice(1);
String.prototype.ucfirst = function() { return this.charAt(0).toUpperCase() + this.slice(1);
String.prototype.ucfirst = function() return this.charAt(0).toUpperCase() + this.substr(1); };
String.prototype.ucfirst = function() { return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase();