Skip to main content

Posts

Showing posts from January, 2015

CodeCademy Explaination -- Javascript Search Text For Your Name 5/7

First, don't feel bad, this lesson's instructions are kind of confusing. You can skip to what you need if you want. 4 Posts: 1.) Explaining For Loops 2.) Exercise 5/7's if statement 3.) Exercise 5/7's inner loop 4.) Exercise 5/7's push statement 1.)  First you need to understand how  for loops  work. For loops are really useful for doing something over and over.  Example: For every horse in the barn, tell me the horse's name and it's age.  You'll be going to a horse over and over again to get it's name and age. But computers are stupid so you have to be reallyyyy specific about it, like this: For ( every horse in the barn starting at the one in the first stall; until you get to the 12th stall; go to the next stall) { This is what I want you to do at every stall. Get it's name and age.} Now for the computer to understand us we have to speak Javascript to it because it doesn't know English. In Javascript, that's a for loop