JavaScript JavaScript Basics Working with Strings Combine and Manipulate Strings

Riley Weishaupt
Riley Weishaupt
271 Points

convert string "role" to all upper-case using .toUpperCase()

I did exactly as it is instructing me to do. the error that i am getting is " use the ' .toUpperCase();'

app.js
let firstName = "Riley";
let lastName = "Weishaupt";
let role = 'developer';
const msg = firstName + ' ' + lastName + ":" + role.toUpperCase() + ".";

1 Answer

Luc de Brouwer
Luc de Brouwer
Full Stack JavaScript Techdegree Student 17,937 Points

Hi Riley,

You were almost there. If you pay close attention to the sentence you weren't told to explicitly include a dot in the end, so if you remove the + "." in your sequence, the challenge will pass. Also, I wouldn't recommend using const for these particular string concatenations, as later on in coding challenges or the javascript stack data needs to be modified, and const won't allow you to modify its original data once it's created. If you would turn it into a third let variable this will be much less error-prone :).

Well done

Riley Weishaupt
Riley Weishaupt
271 Points

Thank you so much! So what I ended up having to do was: let msg = 'firstName' + " " + 'lastName' + ":" + 'role.toUpperCase';