Arrays
Taking an element by its index, changing one, counting, and passing an array to a method.
Section 4.3 laid down the brackets and for … in: several values under one name, taken one at a
time. That was all it took to traverse, and no more — the array stayed a queue you follow from
start to finish, never able to reach into it.
This section opens it up: reaching an element by its index, changing one, knowing how many there are. And, now that methods return values, passing one as a parameter.
In this section
- 6.1Taking and changing an element
The index in brackets, .length to count, and the first error of this course that only happens at run time.
- 6.2Traversing by index
The counted for loop finally earns its keep — and the one-step-too-far shows up at run time.
- 6.3An array parameter
The array type written out, and the absence of a variadic symbol — a lone value wraps itself.