JavaScript program to convert given string to upper case


Following program shows you how to convert given string to upper case.
In this program we get string from user and convert that string to upper case using .toUpperCase()

var input = prompt("Please enter a string:");
var upperCase = input.toUpperCase();
console.log("Given string in lower case: " + upperCase);

Output:

Please enter a string:
hello
Given string to upper case: HELLO