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 Simplify Repetitive Tasks with Loops A Closer Look at Loop Conditions

How many of you get it right?

Just a quick question to find out how many of you beginners are getting the challenges fully correct without following along with the videos? By this I mean for the last video we had to create a random # and have the computer guess until it was correct, which we did via a while loop. Before I watched the whole video, I tried to complete the task but I am often getting the right code in the wrong places! Once I watch the video, I understand where I went wrong but I'm a little disappointed I haven't been able to complete them on my own in some cases. Doing fine on the quizzes and challenges otherwise. Kudos to Dave & Treehouse for a job well done. Thanks everyone for your feedback and encouragement. This is a wonderfully supportive group.

5 Answers

Hey dotz!

I totally get where you're coming from. I've learned about loops, arrays, and the like before coming to Treehouse and I still struggle to master some of the basic concepts. Like you, I don't always get the challenges correct.

However, I've noticed that each time I revisit a key concept and then try it out on my own, the content becomes a bit more solidified. As time goes on and the more we practice these things, the greater the momentum we'll gain.

I'll share some ideas that are helping me learn:

  1. Slow waaay down! I re-watch sections of these videos when I don't understand something. After a function is explained, I pause the video on the code and then explain it to myself. I don't move on until I understand what is happening in the code and could explain it to someone unfamiliar with JavaScript. Slowing down saves time later.

  2. Get creative! For instance, after learning about functions and if/then conditionals, I went to an ecommerce website and wrote a simple function that returned the innerHTML from the stock message of a specific product. I then created an if/then statement to alert me if the stock on the page had changed. I noticed that the stock on an item was at 3. If I return to the page and run my code in the console, it will tell me if the stock has changed. It's not very useful (reading the stock message is obviously much faster than pulling up the console and running my code), but it did give me experience in working with an actual website and extracting data that changes over time. And, I'm that much more comfortable with working on the web. Getting creative forces me to reach beyond the classroom and into real life situations.

  3. Make flash cards! I'm hand writing definitions, function names and what they do, and writing out complete conditional statements/loops/etc. My newest flash card states, "Create a while loop that counts from 1 to 10" with the answer written on the back. Trying to form the loop from memory is a bit tricky, but it forces me to really think through every component in the code. Sometimes the lessons in these videos seem simple enough, and I might think I've got it down...but give my mind a couple days off and things aren't as clear. Flash cards keep me focused on the basics, so advanced programming will hopefully come more naturally.*

  4. Buy a book and follow along! I just recently bought Dave McFarland's 'JavaScript and jQuery: the missing manual' book. It covers most (if not all) of the topics in these JavaScript videos. However, it includes new challenges for creating functions, arrays, loops, and so forth. I'll typically watch Treehouse videos and then go back and read that section in his book. Watching videos and going through a book is repetitive and time consuming, but if you're anything like me (slow learner and require hands on training), it will really benefit you.

Hope that helps!

  • Daniel H

*To further test myself, I'm even considering writing a quiz program with all my flashcard questions in it. That way I can practice programming and study for it at the same time! The program should include the following:

  • All my questions and answers.
  • If I get a question right, then I won't answer it again for a few days.
  • If I get a question wrong, then I should answer it again the next day.
  • I should not repeat any code. If I do repeat code, then I should go and learn how to not repeat it.

Oh it's so good to know there are learners who need reinforcement! I LOVE the flashcard quiz idea as I also write everything down despite it being in every book and online. I've tried a few books already but like Dave's style and will pick up his book. Thank you for the time spent responding to my concerns Daniel.

You're most welcome!

Christopher campbell
Christopher campbell
1,996 Points

Great suggestions that I will attempt to implement. It's a great idea to take some of Tree House tutorials and trying to use them in you own programs; definitely a great way to retain what you are learning.

LaVaughn Haynes
LaVaughn Haynes
12,397 Points

I started doing js in the late 90's but I quit because it was a whole lot of trouble for very little gain for what I did. When jQuery came out I fell in love. Then I started looking at Angular. Now I'm going back to the basics because I want to learn. I feel like these libraries should make things convenient, not be a crutch. I can only imagine where I would be now if I hadn't quit back then. Anyway, the point of my story is that you should feel good for being in here trying even if you make a few mistakes. Just don't get discouraged and quit. I certainly regret it. Dave is awesome is so is the community. Good luck!!

Thank you LaVaughn!

Dave McFarland
STAFF
Dave McFarland
Treehouse Teacher

Hi dotz

Daniel Hurd's advice is spot on. Don't be discouraged if you're not able to figure out the challenges -- that's why you're at Treehouse: to LEARN and PRACTICE.

Whatever you do, don't just skip straight to the "Challenge Solution" video where I show you how I programmed the solution. It doesn't matter if you get the challenge right, but it does matter that you stretch yourself and your brain by trying to apply the concepts from the course to a programming project. This is the real practice you need.

Spend time on the challenge and really work on a solution. If you can't figure it out right away, then take a break for an hour or even over night. Take a walk or do some other activity -- our brains work when we're focused on a task, but also when we do other things: our minds work on problems even when we don't think about them directly. This is called "diffuse thinking" and is responsible for the "ah ha" moments when you suddenly think of a solution to a problem. You can learn more about that here: http://www.sciencefriday.com/blogs/09/04/2014/how-pinball-helps-explain-ways-we-think-and-learn.html?series=33

Just following along with me is one way to get exposure to programming, but only by practicing on your own are you really going to get it!

Good luck. I'm sure, if you stick with it, you'll be able to understand and apply your JavaScript knowledge on your own.

Árpád Tóth
Árpád Tóth
6,504 Points

Hey dotz!

What I really like about Dave's courses is these challenges. Usually I work on them before watching the solution video.

The great experience I got from the challenges is that as a beginner my code sometime looks unstructured and probably a handful of re-factoring is necessary after the first try, but first of all it gives you instant feedback which is usually a positive one and second after watching the solution you could check where you can improve your code.

It is also fun to go back to earlier challenges and introduce new knowledge you learned later on in JS courses. For example adding some loops to earlier if/else challenges could really spice things up :).

Keep up! :)

Eugen Oanta
Eugen Oanta
5,657 Points

I am very frustrated as well, I went smoothly through HTML and CSS , almost flawless, only to slam myself against the JS brick wall, I was not able to complete a single code challenge without help or .... ahhhh , nevermind.