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 trialjohnny louifils
Full Stack JavaScript Techdegree Graduate 18,926 PointsAm I getting this right?
It keeps saying syntax error
var id = "23188xtr";
var lastName = "Smith";
console.log(id.toUpperCase));
<!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>
4 Answers
Michael Weller
7,464 PointsHey, First there is a small spelling mistake in that it should be id.toUpperCase() rather than id.toUpperCase).
I believe HIDAYATULLAH is incorrect, id is still considered a string even if it has numbers in it. What you wrote should work.
Mike Hatch
14,940 PointsThe code as you currently have it will produce the following error in Google Console:
Uncaught SyntaxError: Unexpected token )
That's because you're not calling the method with correct syntax in your code. There should be two parentheses. Did you make a typo or was that a syntax error? If it was just a typo, console logging it will only print out the function. It will not invoke the .toUpperCase
method.
KRIS NIKOLAISEN
54,972 PointsYour syntax error is that you are missing ( in toUpperCase(). The challenge asks you to assign this to userName.
HIDAYATULLAH ARGHANDABI
21,058 PointsIt has only a spelling mistake it should work properly.