Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Daniel walls
Daniel walls
2,174 Points

Hey everyone. Need help "combining and manipulating strings" in JS basics course

Finally, convert the string stored in role to uppercase letters. The final msg string should look similar to this: "Carlos Salgado: DEVELOPER".

let firstName = "daniel"; let lastName = "walls"; let role = 'developer'; let msg = "daniel" + " " + "walls" + ": " + "developer.toUpperCase";

this is my code and I cannot figure out what is wrong. When checking my work I receive this message..

Bummer: Make sure you're concatenating : to lastName and role.

3 Answers

I mean like this:

let msg = firstName + " " + lastName + ": " + role.toUpperCase();

Although technically you can do it your way too; just move the toUpperCase() method outside like this:

let msg = "daniel" + " " + "walls" + ": " + "developer".toUpperCase();
Daniel walls
Daniel walls
2,174 Points

ohhhh I see now!

Yes I can see now how it can work both ways. And I didn't realize that I was supposed to have .toUpperCase outside of "developer". That did the trick!

Thanks So Much.

Please see the Markdown Cheatsheet on how to format code for better visibility.

Your code (edited for better visibility):

let firstName = "daniel"; 
let lastName = "walls";
let role = 'developer';
let msg = "daniel" + " " + "walls" + ": " + "developer.toUpperCase";

First, you should use the firstName, lastName, and role variables instead of typing "daniel", "walls", and "developer". Second, you need parentheses after toUpperCase.

Daniel walls
Daniel walls
2,174 Points

thanks for the heads up about Markdown Cheat sheet, didn't know about that. but unfortunately I'm still getting an error message.

Bummer: Make sure you're concatenating : to lastName and role.

My code is written as seen here.

let firstName = "daniel";
let lastName = "walls";
let role = 'developer';
let msg = "daniel" + " " + "walls" + ": " + "developer.toUpperCase()";

you suggested that I use the firstName, lastName, and role variables instead of typing "daniel", "walls", and "developer. I'm not sure what you mean by that.

try:

var msg = "daniel" + " " + "walls" + ": " + "developer.toUpperCase()";