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
mrx3
8,742 PointsHaving some trouble with the JavaScript course.
I'm not really learning a lot from the course. I'm having a hard time following along and understanding some of the concepts in the course. Did anyone else have trouble with the course? I'm pretty good with using Jquery, and plugins, but for some reason I'm having a heck of a time JavaScript. I have the book JavaScript and jQuery The Missing Manual, and that book is awesome. Is it possible to learn jQuery first? I can make a basic function and a if, else, if statement. How much JavaScript do I have to know to be able to be a Web Developer? I'm kinda of feeling discouraged.
Thanks in advance for any help.
mrx3
8,742 PointsFirst thanks again for the help John and Matt, I really appreciate it. The first question I have is, why would you want to use a while, and do while loop? I understand that with a do while loop, you want to execute the code inside the code block at least once. So, for example, I have a form that has a question that must be answered, the age of a user for instance. Could I use a while loop, or a do while loop to "force" the user to enter his or her age?
john larson
16,594 Pointsx, you ask a very good question as to why you would use a while or do while loop. In the JavaScript course you don't see them much again after those few exercises. However now that I'm doing Python while loops are a regular occurrence. As far as using a while or do while to check for input validation, I believe I have seen both those loops used in that way. So, good on you :D
4 Answers
john larson
16,594 PointsI would say IF you learned jQuery first then you definitely can. There seems to be a lot of things that can be done in jQuery that you don't need the whole JavaScript background.
mrx3
8,742 PointsjQuery is awesome. My mind is backwards for some reason. So far with jQuery I can make images fade in and out, make a login form fade into the page, I'm starting to work with jQuery UI, and making dialog boxes appear on the screen. Oh, and I also learned how to do validation on form using a jQuery plugin. It's so weird that I get jQuery, but with JavaScript I need my hand held.
Matthew Francis
6,967 PointsI wold go with what most of the crowd voices, go with Javascript than go for JQuery.
JQuery IS THE SAME LANGUAGE, but it is a framework that makes writing Javascript more easier. If you go with Javascript first, you would be exposed to knowing how Javascript works without shortcuts.
If you do not comprehend Javascript, you likely would not understand JQuery.
Lastly, don't give up! I was once at the same place as yours, keep asking questions, re-watch the videos, do it until you understand it, no matter how long it takes.
mrx3
8,742 PointsThanks for the kind comments Matthew, I really appreciate it.
john larson
16,594 PointsI guess I would ask this. What part of JavaScript are you stuck on? do you understand variables? conditional statements?
functions? How the prompt asks a question and stores the feedback? I guess I'm asking if you can take an inventory of what you HAVE picked up from the course. If you are entirely new to programming, there is a lot of information to take in.
I have been through the JavaScript courses several time and I always pick up more, and realize there's things I forgot.
Matthew Francis
6,967 PointsExactly this!
mrx3
8,742 PointsHi Jason thanks for the reply. I'm mostly stuck on while, and do while loops. I just completed the code challenge where we do the RGB colors, and we eliminate the redundant code. I really struggled with the while and do while stuff, but I Aced the the for loop, and the first code challenge. I understand variables, prompts, if else, and if else if statements, and functions.
Matthew Francis
6,967 PointsWhile loops and do while loops are simple!
While loops keeps iterating over the loop until the condition in the loop is proven false.
while(condition == true){
//do something
if(condition == a false condition){
return; //used to break the loop, or else the while loop is going to continue forever and eventually crash your desktop
}
}
In do-while loops, javascript execute everything in do once only, then execute the while loop,
do{
console.log("hi");
}while(condition == true){
//do something
if(condition == a false condition){
return; //used to break the loop, or else the while loop is going to continue forever and eventually crash your desktop
}
}
As an alternate resource, search "thenewboston" in youtube, he teaches a lot of things, incuding javascript. His explanation is concise and straightforward.
Casey Ydenberg
15,622 PointsDo you have any other programming languages under your belt (not HTML and CSS ...)
JavaScript can be tough place to learn programming for the first time. You might try some of the Python or PHP courses just to get the concepts clearer in your head, then go back and tackle JS.
mrx3
8,742 PointsPython, and a little bit of MySql from a class I took in college.
john larson
16,594 Pointsjohn larson
16,594 PointsHey x, sounds like you've come a long way and learned some great stuff. jQuery is a lot more concise cause it's doing all the JavaScript behind the scenes. If all your stuck on so far is while and do while I'd say your doing great!. That being said, if you have any specific questions on either of those loops, ask away :D