Javascript String toUpperCase()

Introduction

Javascript String toUpperCase() converts string to upper case.

str.toUpperCase()

The converted string is returned from the method and leaves the original string unchanged.

let stringValue = "hello WORLD"; 
let a = stringValue.toUpperCase();
console.log(a);  // "HELLO WORLD" 
console.log(stringValue);/*from www .j  ava 2s  .c  o m*/



PreviousNext

Related