Strings in JavaScript come with built-in methods - special functions that can transform or analyze strings. A method is called using a dot . after the string.
The basic syntax looks like this:
↗️
Loading editor...
↶
↷
The .toUpperCase() method converts all letters in a string to UPPERCASE. Notice that the original string codemonName doesn't change - methods return a new string!
Strings Are Immutable
In JavaScript, strings cannot be changed after they're created. Methods like .toUpperCase() don't modify the original string - they create and return a brand new string with the changes applied.