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 Interactive Web Pages with JavaScript Selecting Elements and Adding Events with JavaScript Adding Events

Adama Sy
Adama Sy
7,076 Points

Javascript hard to understand

I have finished the basic and went through Jquery getting the right answers.

but when i sit and try to do things by myself, it does not work.

this means I did not understand it. well I can't event write a small code. :(

What are you trying to do? For me, JavaScript came easy because I thought of it in terms of what I wanted to do with it. Maybe we can go over some things and see what parts you don't understand.

5 Answers

It's okay. When you move from HTML and CSS to a programming language like JavaScript, you're learning a new language all over again. And the only way to do that is through practice and time. Just let it simmer in the back of your mind; you'll get it eventually. For me, it took more than a year to understand these concepts, and I still feel very inexperienced!

Also, JavaScript has a few complexities that can make it a little hard to understand, namely callbacks and event listeners. I sure know I didn't get those for a long time! I'd recommend you try learning PHP; it looks similar to JavaScript, but without the added complexity of the DOM.

What worked great for me is building a simple JavaScript app while I was learning. It helped reinforce what I was learning.

Matthew Cooper
Matthew Cooper
3,379 Points

Greetings Adama,

I am pretty new to JS myself and to me it sort of sounds like maybe you are having trouble with the scope. I had to go over the scope a few times to get it down in my head. If you are getting undefined then what you are calling was never assigned a value or was never given something to return.

If it is a function maybe you do not have a return for whatever you are trying to get out of the function. Or you could be trying to call a var that is outside the scope you are working in. Just a few thoughts.

If you have not done the Interactive Web Pages with JavaScript course that just came out you may want to go over that to help get things locked down in your head.

Adama Sy
Adama Sy
7,076 Points

I'm on that part of JS. I'm working on the new one. I have no issue going through challenges as the pretty much similar to the videos. 90% of the time they are things from the video. So straight forward

Adama Sy
Adama Sy
7,076 Points

Ok, I will try building app at the same time, but for me i really was thinking I understood what I learned. it's like frustrating ....

I want to build a web app for work .

but i can't even start. there is no fault in Javascript console but everytime I want to do something it says undefined. I got so frustraed I deleted it all.

But will do it again later when i calm down

Ryan Boone
Ryan Boone
26,518 Points

I know how you feel. Definitely step away for a while and come back with a fresh pair of eyes. I've been in the same boat as you. There is some really good advice here.

It's true that beginning an app can really help you grasp the complexities of Javascript, mostly because you begin solving actual problems in the real world. I will tell you this: it's going to be difficult and it probably won't turn out how you want it to, but that's okay. You didn't learn to walk and talk overnight.

I appreciate your candor and I want to encourage you to keep it up! The folks here on the forums are extremely helpful. Also check out Stack Overflow, just make sure you have a specific problem to address.

nicholastillman
nicholastillman
8,319 Points

Encouraging. I have been going at it for a while. I think issue is trying to jump the gun rather than view video, iterate, and build something that is basic and build upon when I come to a new subject/topic in JS. (I have been a script kittty far too long!) You are not alone in your journey .