Arrays - Reading Assignment

Arrays allow us to store a group of numbers or strings as an indexed set which can be used as a variable.

First array element is accessed by putting the array name followed by the index of the first item (in the computer-counting style beginning with zero) and surrounded by square brackets, so like this: arrayName[0].

1 Like
  1. An Array lets you store multiple values in a single variable and stores a collection of data.

  2. First element is in index 0

1 Like
  1. An array is a vector or an indexed list the elements of which are all of the same type.
  2. The first index is 0.
1 Like

Hi Jon, thanks for your comment, here it says that arrays store fixed size sequential collections of elements, but your comment makes more sense to me. :smile: https://www.tutorialspoint.com/javascript/javascript_arrays_object.htm

1 Like

store multiple values in a variable

[0]

1 Like

What do arrays allow us to do?

  • Arrays allow us to attribute multiple values to individuals variables. It’s a collection of data for the variable.

What index should you use in order to access the first element in an array?

  • Arrays count from 0 - hence the first element would be 0.
1 Like

Hi @cryptocrom,

…but without the gifts before the array: this will throw an error.

1 Like

Hi @FrankB,

In fact, an array can store values of different types, although you are right that they are predominantly used to store and manipulate values of the same type.

As you have said, the key thing with arrays is that they store their values as a sequence: “an indexed list”.

1 Like
  1. What do arrays allow us to do?
    It allows us to store multiple values in a single variable.
  2. What index should you use in order to access the first element in an array?
    0, i.e Array[0]
1 Like
  • What do arrays allow us to do?
    they give us an ability to store multiple values within the same variable

  • What index should you use in order to access the first element in an array?
    zero

1 Like
  1. What do arrays allow us to do?

Store multiple values of same type in a single variable.

  1. What index should you use in order to access the first element in an array?

0

1 Like
  1. What do arrays allow us to do?
    Arrays allow us to store many values in a single variable.

  2. What index should you use in order to access the first element in an array?
    arrayName[0] returns the first element.

1 Like
  1. What do arrays allow us to do?
    Store multiple values in one variable

  2. What index should you use in order to access the first element in an array?
    0

1 Like
  1. An array object allows us to store multiple values on a single variable.
  2. The first index number is zero [0], therefore Array[0] is the first element.
1 Like
  1. What do arrays allow us to do?
    The Array object lets you store multiple values in a single variable.

  2. What index should you use in order to access the first element in an array?
    [0]

1 Like

Arrays allow us to store sequences of values.

The first element in an array is always 0

1 Like

An array is a data structure where a single object holds a list of related variables that have the same data type. An example of an array might be an object call fruit and it might hold a series such as orange, apple, banana, grape, apples….

The first item in an array starts with an index of zero.

1 Like
  1. Arrays allow us to group values and strings in a variable.
  2. To access the 1st element in an array, (index = 0), because indexes in arrays begin with 0.
1 Like
  1. Arrays allow multiple values of the same type to be stored in a single variable.
  2. Array indexes start with 0, [0] is the first element.
1 Like

What do arrays allow us to do?
An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type.

What index should you use in order to access the first element in an array?
The first element on an array is indexed with 0

1 Like