JavaScript Arrays

How do you 'interface' with an array in JavaScript?

Well, you need to know how they work, which includes knowing:

  1. They are objects (that have properties and methods, just like objects in any language)
  2. You work with them by using their properties and methods

You interface with an array (or any object) by using it's properties and methods. Properties and methods are the tools you use to solve problems.

The API (application programming interface) of an object is it's collection of properties and methods that you can use.

Here are some references on array methods in JavaScript:

  1. This one is fairly easy to understand
  2. This one is more complete but more difficult to understand

There are many others, you should find one you like!

In this activity we'll explore the Array API in JavaScript.

But first, remember that when using a method you should understand 3 things:

  1. What does it do? (But you don't need to understand how it does it)
  2. What parameters can you pass in (including the data types of parameters)
  3. What does it return (including the data type)