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 trialpakarang buacharoen
Full Stack JavaScript Techdegree Student 1,897 Pointsi am struggling with getting through task contain .toUpperCase
i dont seem to understand what i have done wrong on this. please help if you have any clue.
thank you so much
let firstName="Pakarang";
let lastName="Buacharoen";
let role = 'developer';
let mew = role.toUpperCase();
let msg= 'firstName' +' '+ 'lastName+':'+ 'mew' +'.';
2 Answers
Andrew Hickman
Full Stack JavaScript Techdegree Graduate 22,832 PointsHey! So, the problem is how you formulated you string concatenations. There is nothing wrong with the toUpperCase method. If you want to display the value of a variable, you need to leave it outside quotation marks. For example:
let firstName="Pakarang";
let lastName="Buacharoen";
let msg = firstName + " " + lastName; //value of msg is "Pakarang Buacharoen"
Do you think you can rewrite the assignment to msg
that will produce the right string value?
Andrew Hickman
Full Stack JavaScript Techdegree Graduate 22,832 PointsGreat job! You're getting the hang of it. Now, the interpreter is looking at the variable msg
for your answer, but you have it stored in a new variable called mew2
. Instead of assigning the answer to a new variable, can you figure out how to store it in the msg
variable that you've already created?
Also, don't forget the space after the colon. ": "
pakarang buacharoen
Full Stack JavaScript Techdegree Student 1,897 Pointsgot it thank you so much, just passed that task :D
Andrew Hickman
Full Stack JavaScript Techdegree Graduate 22,832 PointsAwesome, way to go!!!
pakarang buacharoen
Full Stack JavaScript Techdegree Student 1,897 Pointspakarang buacharoen
Full Stack JavaScript Techdegree Student 1,897 PointsThe challenge question is
Challenge Task 3 of 3 Finally, convert the string stored in role to uppercase letters. The final msg string should look similar to this: "Carlos Salgado: DEVELOPER".
and once i clicked submit, it shows Bummer: Make sure you're concatenating
:
tolastName
androle
.