Großbuchstaben JavaScript
var str = "Hello World!";
var res = str.toUpperCase(); //HELLO WORLD!
Batman
var str = "Hello World!";
var res = str.toUpperCase(); //HELLO WORLD!
let str = "Hello World!";
let res = str.toUpperCase();
console.log(res) //HELLO WORLD!
var string = "A string";
var upperCase = string.toUpperCase();
console.log(upperCase); // -> A STRING
var lowerCase = string.toLowerCase();
console.log(lowerCase); // -> a string
.toUpperCase()
// Like this:
alert("In upper case: " + "my string".toUpperCase()); // In upper case: MY STRING
const str = 'flexiple';
const str2 = str.charAt(0).toUpperCase() + str.slice(1);
console.log(str2);
//Output: Flexiple
const str = 'abc efg';
const str2 = str.charAt(0).toUpperCase() + str.slice(1);
console.log(str2);
//Output: Abc efg
const upperCase = (string) => {
const newText = string.toUpperCase();
return newText;
};