This post is part 15 of 92 in the series Programming by Stealth

At this stage we’ve learned about five key components to any programming language, and how they are implemented in JavaScript – variables, operators, branching, arrays, and loops. Now it’s time to add another – functions.

A function is a collection of statements that is given a name so it can be easily re-used. We’ve already used functions, but without knowing that’s what we’ve been doing.

Read more

Tagged with:

This post is part 14 of 92 in the series Programming by Stealth

At this stage we’ve learned about three of the key components common to just about every programming language, and how they’re implemented in JavaScript – variables, operators, and branching. Now it’s time to add two more – arrays, and loops.

Arrays store a list of related data in a single variable, and loops allow us to apply the same action over and over again. To process an arbitrarily long array, you need some kind of iteration, and loops are the simplest way of achieving that.

Read more

Tagged with: