Javascript String toCap()

Description

Javascript String toCap()


String.prototype.toCap = function () {
 return this.toUpperCase().charAt(0) + this.slice(1,(this.length));

}

Javascript String toCap()

'use strict';/*from w  w  w. j  a va  2 s. c om*/

Object.defineProperty(exports, "__esModule", {
  value: true
});

exports.default = function (obj) {
  return String.prototype.toCap.apply(obj);
};

String.prototype.toCap = function () {
  var result = this.toUpperCase().charAt(0) + this.slice(1, this.length);
  return result;
};



PreviousNext

Related