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

General Discussion

Adam Maley
Adam Maley
5,946 Points

Looking for some guidance, JavaScript (and everything ahead of it) got me down.

Not giving up but I have to keep playing the same videos over and over, and I feel like I am not retaining or understanding a good portion of this. I get arrays and objects, I just don't get how to apply them on my own really.

I have about 2 hours per day to learn all of this, and I am totally ready to be a professional. I dabbled in Web Design and game making things since high school and I'm now 29. It's time to move up in life.

I also don't understand this function print(message) {var outputDiv =document.getElementById...ect. I also noticed { and [ brackets being switched for objects and arrays being within each other, so that's kinda getting me.

This all reminds me of math classes and feeling like there is an invisible wall preventing me from solving the problem.

I checked my college for a hands-on JavaScript coarse but they only have dated Python ones.

I feel as if I need a mentor.

2 Answers

Steven Parker
Steven Parker
231,261 Points

You're in luck, someone else just asked about that same function today and got some very thorough responses. Check out that other question at this link.

Also, you might enjoy this episode of the Treehouse Show that discusses learning issues and solutions (including a few suggestions by me!). And if you have access to the bonus material, there's a series of videos called Learn how to Learn you might find useful.

Jimmy Crandall
Jimmy Crandall
23,120 Points

To supplement Steven's answer:

I hate to say it, but you just have to keep at it! Think of learning a programming language (i.e. Javascript) like you're learning to speak a new language. There are certain rules about grammar and punctuation (syntax in programming) that are learned by example. The more code you look at and familiarize yourself with, the more you'll begin to understand it all.

Square Brackets [ ] are used to create an array that contains multiple items.

var people = [jackie, jason, jamie, jerry];

Curly Braces { } are used to create an object that is made up of key: value pairs.

var jackie = {
  firstName: 'Jackie',
  lastName: 'Smith',
  age: 21,
}

Square Brackets [ ] can also be used to access an object's key: value pair.

var jackie = {
  firstName: 'Jackie',
  lastName: 'Smith',
  age: 21,
}

return jackie['age'];

//returns 21;

The items in an array can be more arrays or even whole objects. The value of a key: value pair can also be an array or another object. Nesting arrays and objects can get confusing quickly, but being diligent with your typing and indentation can help a ton.

Whatever you get stuck on, don't get discouraged! You learn the most when you solve a problem or get past a roadblock. There's so much info out there and so many people willing to help. Despite what anyone says, we're all still learning!