Introducing JavaScript Functions and Loops
(Page 1 of 4 )
Today, you will learn about functions from a man who can barely function, because it is 8:48 in the morning and my soda has yet to kick in. I would say wait for it, but I know you are so excited to read the rest of this article that you can't function. And if you can't function, and I can't function, how is JavaScript gonna function? Well, you'll have to keep reading to find out.
Function Junction
I never watched "Conjunction Junction" before, although I do remember that Bill up on Capital Hill for some reason. I was more into Reading Rainbow, Captain Kangaroo, and the Smurfs.
Functions in JavaScript (as well as every other language) are a block of code you can use over and over again. It saves the programmer from having to code certain items throughout the program. For instance, if you play a video game and the X button makes your character do a roundhouse kick, pressing that X button triggers that function each time. Imagine playing Tekken or Street Fighter, and the poor programmer who would have to individually program each kick you did. It would take forever.

You saw examples of functions in our previous tutorial. Now we are going to take a closer look at them and learn how to call them, or trigger them into action. So sit back, grab yourself a case of Jolt Cola, set your phone to vibrate, and let's get to work.
Next: Putting the Fun in Your Functions >>
More JavaScript Articles
More By James Payne