Convert Strings to Upper and Lower Case in Javascript

Convert Strings to Uppercase:

A String can be converted to upper case in Javascript with toUpperCase() function.
e.g.

var txt = "lucknow";
var txtInUppercase = txt.toUpperCase();
console.log(txtInUppercase);

This would print “LUCKNOW” on the console.

Convert Strings to LowerCase:

A String can be converted to lower case in Javascript with toLowerCase() function.
e.g.

var txt = "LucKnoW";
var txtInLowercase = txt.toLowerCase();
console.log(txtInLowercase);

This would print “lucknow” on the console.