JavaScript has built in methods to manipulate strings making this task easy. You can call the toLowerCase() or toUpperCase() on the string directly.
Make a string lower case.
var str = "Hello World!"; var lowerCaseStr = str.toLowerCase(); console.log(lowerCaseStr);
Make a string upper case.
var str = "Hello World!"; var upperCaseStr = str.toUpperCase(); console.log(upperCaseStr);