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 Loops, Arrays and Objects Tracking Data Using Objects The Build an Object Challenge, Part 2 Solution

Hunter G
Hunter G
6,612 Points

Why are all of my variable values being printed as "undefined" ?!

see snapshot below. EVERY single value is being printed as undefined..

https://w.trhou.se/2564l8ro4c

Student: undefined Track: undefined Points: undefined Achievements: undefined

for ALL students. I thought I followed Dave's code correctly but maybe theres an error somebody can catch?

1 Answer

Max Karacsony
Max Karacsony
23,928 Points

Take a careful look at your students.js file where you define the keys of each student object. Keys are case sensitive. Take a look at this short example.

var myObject = {
   foo: "bar"
}
console.log(myObject.Foo) // prints undefined
console.log(myObject.foo) // prints "bar"

MODERATOR Edited: Move from Comment section to Answer section so it may be up-voted / marked as Best Answer

Hunter G
Hunter G
6,612 Points

you are awesome, good eye!