String.prototype.toUpperCase()
O método toUpperCase()
retorna o valor da string original convertido em letras maiúsculas.
Sintaxe
str.toUpperCase()
Valor retornado
Uma nova string representando a string original convertida em maiúsculas.
Exceções
Descrição
O método toUpperCase()
retorna o valor da string convertido para letras maiúsculas. toUpperCase()
não altera o valor da string original.
Exemplos
Uso básico
js
console.log("alfabeto".toUpperCase()); // 'ALFABETO'
Especificações
Especificação | Status | Comentário |
---|---|---|
ECMAScript 1st Edition (ECMA-262) | Padrão | Definição inicial. Implementado no JavaScript 1.0. |
ECMAScript 5.1 (ECMA-262) The definition of 'String.prototype.toUpperCase' in that specification. |
Padrão | |
ECMAScript 2015 (6th Edition, ECMA-262) The definition of 'String.prototype.toUpperCase' in that specification. |
Padrão | |
ECMAScript (ECMA-262) The definition of 'String.prototype.toUpperCase' in that specification. |
Padrão em tempo real |
Navegadores compatíveis
BCD tables only load in the browser