JavaScript JavaScript Basics Working with Strings Combine and Manipulate Strings

Alexandru Pescaru
Alexandru Pescaru
4,561 Points

can anyone help me here with the toUpperCase please

app.js
let firstName = "Alex";
let lastName = "Pescaru";
let role = 'developer';
let msg =  firstName + ' ' + lastName + ":" + role + "."
let msg = role.toUpperCase();
Justyna Szofinska
Justyna Szofinska
6,058 Points
let firstName = "Alex";
let lastName = "Pescaru";
let role = 'developer';
let msg =  firstName + ' ' + lastName + ":" + role.toUpperCase(); + ".";
console.log (msg);

I don't know exactlly what you want to achive with this code, but first you forgot semicolumn in 4 line, and you don't have line of code to show you what the msg variable contains. In let variable you can add new information by += sign, but you can't have two different informations. You can also create new variable " let upper = role.toUpperCase();", and then in "let msg" you will use "upper" instead "role". I hope I helped a little.

1 Answer

Sumana Vittal
Sumana Vittal
4,701 Points

let firstName = 'Alex'; let lastName = 'Pescaru'; let role = 'developer'; let msg = firstName+' ' +lastName+ ':'+ ' '+role.toUpperCase()+ '.';

console.log(msg);