Javascript String toUpper()

Description

Javascript String toUpper()

String.prototype.toUpper = function() {
  return this.replace(/[a-z]/g, (x) => String.fromCharCode(x.charCodeAt(0) - 32));
};



PreviousNext

Related