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 JavaScript Basics (Retired) Storing and Tracking Information with Variables Using String Methods

emmanueltoyinajayi
emmanueltoyinajayi
685 Points

i don't know how to get these done

all am getting is task 1 not passing

app.js
var id = "23188xtr";
var lastName = "Smith";

var userName =id.toUpperCase();
index.html
<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
</head>
<body>
<script src="app.js"></script>
</body>
</html>
Kieran Barker
Kieran Barker
15,028 Points

Hey buddy,

You're close! This is the correct code for the challenge:

var id = "23188xtr";
var lastName = "Smith";

var userName = id.toUpperCase();

It's because you're missing a space between = and id. I hope this helps!

2 Answers

Steven Parker
Steven Parker
231,236 Points

This code is a passing solution for task 1. The space (or lack of it) Kieran mentions will not cause a problem.

But if you're seeing the message "Oops! It looks like Task 1 is no longer passing.", that would only happen if you're working on task 2. But it doesn't look like you've added any code for task 2 yet, and this code would not cause that message.

Please revise this question to show the actual code you're submitting for task 2.

Kieran Barker
Kieran Barker
15,028 Points

Fair enough. I assumed it was just being picky for two reasons:

  • I quickly tried the challenge and it accepted my answer, so I assumed that was the problem. I’ll look more closely next time.
  • I was helping a colleague with a PHP code challenge. The only reason it wasn’t accepting her answer was because she didn’t put spaces in as I did. Her code was identical to mine, only without spaces in certain areas, such as between if and the opening bracket.
emmanueltoyinajayi
emmanueltoyinajayi
685 Points

Thanks to you all I have been able to resolve that task I was just missing some syntax in task 2