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 trialUnsubscribed User
7,386 PointsConcatenation with #
Help please.
5 Answers
Krzysztof Kucharzyk
Front End Web Development Techdegree Student 4,005 PointsOhhh sorry then I thought that was for the first task :P
So to make this work you should have this code:
var userName = id.toUpperCase()+ "#" + lastName.toUpperCase();
Krzysztof Kucharzyk
Front End Web Development Techdegree Student 4,005 PointsAll you have to do here is to assign this to userName variable:
var userName = id.toUpperCase();
Unsubscribed User
7,386 PointsThank you but that's not the answer to the question I posted. That's the first answer to the first question. I'm looking for the second answer that includes the '#' symbol.
Unsubscribed User
7,386 PointsThe problem to solve is this: Complete the assignment to the userName variable by adding a # symbol followed by an all uppercase version of the lastName variable. In other words, using string concatenation so that the final value of userName is "23188XTR#SMITH".
Jacob Mishkin
23,118 PointsKrzysztof Kucharzyk's first answer is correct. If you need help understanding why, we will be happy to help.
Unsubscribed User
7,386 PointsThat's not the answer. I received this message: You only need to call toUpperCase()
on id
and lastName
.
I cut and paste first. then I typed it in myself. Both returned the above message.
Krzysztof Kucharzyk
Front End Web Development Techdegree Student 4,005 PointsTake a look at the above answer. This suppose to work here:
var userName = id.toUpperCase()+ "#" + lastName.toUpperCase();
You call here toUpperCase() on both id and lastName
Unsubscribed User
7,386 PointsUnsubscribed User
7,386 PointsThanks, Krystof. I did not see this equation in the lesson. If you don't mind my asking, where did you learn this variable pattern?