May
27
PBS 15 of X – JS Functions
Filed Under Computers & Tech, Software Development on May 27, 2016 | 1 Comment
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.
May
12
PBS 14 of X – JS Loops & Arrays
Filed Under Computers & Tech, Software Development on May 12, 2016 | 1 Comment
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.