The toUpperCase() String Method

By: Dusty Arlia
Published on Sunday, March 31, 2013, 02:57 PM
Last Updated on Thursday, July 16, 2015 at 10:21 PM
Total Updates: 2

Strings include several methods. The toUpperCase() method turns your string into all uppercase letters. Here is an example:

var first_name = "Dusty";
var first_name_in_caps = first_name.toUpperCase();

In this example, the variable first_name has the value Dusty. When we use this string's toUpperCase() method, the value DUSTY is assigned to the new variable first_name_in_caps. The last line:


prints the value of first_name_in_caps to the screen.