Arrays - Reading Assignment

  1. What do arrays allow us to do?

Array allowed us to store multiple value in a single variable, or the collection of variable of the same type.

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

This is the Method
indexOf()

The index is
0.

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?
    value[0]

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

An array stores a series of values in a single object, and allows it to manipulated within.

  1. 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?
  • Arrays allow us to store a linear sequence of values
  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 several values in a single variable. We can think of an array as a collection of variables of the same type.

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

Use index 0. Consequently, this means that the maximum index of any array will be its size - 1.

var colours = [ “red”, “orange”, “yellow”];
Here, the size of the array is 3, and “red” is in index 0, “orange” in index 1, and “yellow” in index 2.

1 Like

1)What do arrays allow us to do? A data structure that represents a list of items.

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

1 Like

Arrays allow us to store more than one value to a variable. This means it is a kind of “library” of data; or a collection of same type variables.

The index used is 0. Instead of 1, 2, 3 … the tally is 0, 1, 2 … etc.

1 Like
  1. What do arrays allow us to do?
    The Array object allows for storing multiple values in a var, ie var (train) = (“carriage1”, “carriege2”);
  2. What index should you use in order to access the first element in an array?
    The first value is defined as 0, hence the index is [0]
1 Like
  1. Array allows us to store multiple elements of the same type in a single variable.
1 Like
  1. Arrays allows you to store multiple values in a single variable.
  2. [0] or shift ()
1 Like
  1. Store multiple values of the same type in one variable
  2. 0
1 Like

1. What do arrays allow us to do?

Arrays allow storage of multiple values in a single variable.

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

indexOf(0) should be used to access the first element in an array. 0 is the first element.

1 Like

What do arrays allow us to do?

Arrays allow us to store several values in a variable.

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

row [0] is the first element in an array
row [1] is the second element.

1 Like

1. What do arrays allow us to do?
Arrays let us store multiple values in a single variable. It is a collection of variables of the same type.
Example: var fruits = [“apple”, “orange”, “mango”];

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

1 Like
  1. An array is an object that allows us to put multiple values into a single variable.

  2. indexOf() allows us to access the first element of an array.

1 Like
  1. What do arrays allow us to do?
    The Array object lets you store multiple values in a single variable. It 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.

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

2 Likes
  1. It enables you to store multiple values in a single variable.
  2. You can use indexOf()
2 Likes
    1. Arrays lets you store multiple values in a single variable.
  1. The first index is 0.

2 Likes

indexOf gives you the index of the element in the array, to access the first element, you have to use the index 0.

Hope this clears it out. :slight_smile:

2 Likes

1.) Arrays allows us to save more than one value in a variable.
2.) [0] returns the first element in an array.

2 Likes