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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![shirshah sahel](https://secure.gravatar.com/avatar/ff06aa01776df4c7fda4aeaf55876d77?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
shirshah sahel
10,035 PointsStuck here, when I type Node app.js it would'nt show me the total number of badges and points in javascript .
https://w.trhou.se/6dun89f45p attach is the link to my workspace . I am wondering why it is not showing the total of badges and points in javascript for co workers. Thanks,
//Require https module
const https= require('https');
//Function to print message to console
function printMessage(username, badgeCount, points){
const message=`${username} has ${badgeCount} badges and ${points} points in javascript`;
console.log(message);
}
function getProfile(username){
// Connect to the API URL (https://teamtreehouse.com/username.json)
const request= https.get(`https://teamtreehouse.com/${username}.json`, response =>{
let body="";
// Read the data
response.on('data',data=>{
body += data.toString();
});
response.on('end', ()=>{
// Parse the data
const profile= JSON.parse(body);
printMessage(username, profile.badges.lenght, profile.points.javascript);
// Print the data
});
});
}
getProfile("chalkers");
getProfile("alenahollingan");
3 Answers
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,688 PointsOn this line:
printMessage(username, profile.badges.lenght, profile.points.javascript);
You have "lenght" instead of "length" and "javascript" instead of "JavaScript" (identifiers are case-sensitive).
And on this line:
getProfile("alenahollingan");
That should be "alenaholligan" (just two "n"s).
Also, depending on what version of Node.js you're using, you might not be able to use "let" unless you're also using "strict" mode.
![shirshah sahel](https://secure.gravatar.com/avatar/ff06aa01776df4c7fda4aeaf55876d77?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
shirshah sahel
10,035 PointsAwesome Steven, it totally worked . I need to practice how to type length.
![Amanda Sharp](https://secure.gravatar.com/avatar/1e0be8d448ea099fc179445745129e1f?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Amanda Sharp
15,223 PointsAnd to add on Steven's point
'javascript' should have capital letters like so:
printMessage(username, profile.badges.lenght, profile.points.JavaScript);