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

A good refresher opportunity!

I came back to continue this course after a couple of weeks off, and it turns out I'd forgotten a lot of the basics - especially in terms of syntax.

I got there in the end though. Took me a while to realise that the reason it wasn't working was because I didn't check the index.html was pulling in practice.js using the <script> tag!

There was a bit of trial and error around combining strings and variables. Also a couple of typos that I failed to spot like forgetting to use camelcase ("camelCase?") when returning a variable.

I've aimed to keep my solution simple and lightweight. Nothing too fancy going on here. Was really helpful to have this practice session to jog my memory a bit!


var firstName = prompt("What is your first name?"); var secondName = prompt("What is your second name?");

var fullName = firstName.toUpperCase() + " " + secondName.toUpperCase();

var nameLength = fullName.length;

alert("The string '" + fullName + "' is " + nameLength + " characters long.");

2 Answers

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

Very good!

Don't worry about needing to refresh things from time to time. Or even looking things up via Google. That is part of the skill in Programming. There's really only one way to make everything stick and that is to keep coding! Good luck with it. :)

Thanks! :)