How to make a string uppercase in JavaScript?

To make a string uppercase in JavaScript, do this: string.toUpperCase().

Here's how you do it:

const string = 'Hello World!';

const uppercased = string.toUpperCase();

console.log(uppercased); // HELLO WORLD!