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!
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
JASON GALWEY722 Points
Finally, add a # symbol and lastName in uppercase to the end of the userName string. The final value of userName is "
need help finishing this of Ive tried all possible scenarios I can think off
var id = "23188xtr"; var lastName = "Smith"; var userName = id.toUpperCase() += lastName.toUpperCase();
Ari Misha19,323 Points
Hiya Jason! You literally have to add a "#" between upper cased "id" and uppercased "lastName" variable. Here is my code :
var id = "23188xtr"; var lastName = "Smith"; var userName = id.toUpperCase(); //task 1 userName = id.toUpperCase() + "#" + lastName.toUpperCase(); //task 2 //"userName" outputs "23188XTR#SMITH"
One way to solve this is by using concatenation by just using a + instead of a += like this:
This will concatenate id, the # and lastname into a string and assign it to userName.
Alternatively, if you'd like to continue using the assignment operator +=, you just have to do it one piece at a time so that the variable userName is always on the left of the +=.