Arrays - Reading Assignment

A.1. Array allows us to you store multiple values in a single variable i.e. a collection of variables of the same type. For example,

var fruits = new Array(“apple”, “orange”, “mango”);

A.2. Index zero [0] allows access to the first element in an array . For this example the first element = “apple”.

var fruits = [“apple”, “orange”, “mango”];

fruits[0] is the first element
fruits[1] is the second element
fruits[2] is the third element

1 Like
  1. The Array object lets you store multiple values in a single variable. It stores a fixed-size sequential collection of elements of the same type. 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. Simply meaning arrays allow storage of multiple values in a single variable.
  2. The first element of an array has an index of 0. So the counting of the array starts from 0 and not from 1 -> 0,1,2,3,4…
2 Likes
  1. What do arrays allow us to do?

Arrays are data types that can hold multiple values in a single variable and thus are used to store a collection of data. Arrays come with a number of properties and methods that allow us to work with the data contained in a particular array.

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

The first index of an array is zero, thus “0” must be used to retrieve the first element in an array.

2 Likes
  1. What do arrays allow us to do?
    Allows you to store multiple values in a single variable

var sneakers = [“Fila”, “Puma”, “Adidas”, “Saucony”];

  1. What index should you use in order to access the first element in an array?
    sneakers[0]
2 Likes
  1. What do arrays allow us to do?
    The Array object lets you store multiple values in a single variable. It stores a fixed-size sequential collection of elements of the same type. 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.

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

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

They allow us to store multiples values in single variables. They can be considered a collection of variables in the same category together.

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

The ordinal numbers system is used to access elements in an array. For example:

var games = [“mario”, “zelda”, “spyro”];

games[0]
games[1]
games[2]

The numbers target the values within the variable in syntactical order.

1 Like
  1. What do arrays allow us to do?
    The Array object lets you store multiple values in a single variable. It stores a fixed-size sequential collection of elements of the same type. 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.
  2. What index should you use in order to access the first element in an array?
    First element is stored at position 0
1 Like
  1. Array allows us to store multiple walue in
    a single variable
  2. Use index. 0. to access the first element
1 Like
  1. What do arrays allow us to do?
    It allows us to store a list of values.

  2. What index should you use in order to access the first element in an array?
    The index that has to be used in order to find the first element is 0

1 Like
  1. Arrays allow us to store multiple values of the same type in a single variable.
  2. To access the first element in an array zero index should be used.
1 Like
  1. What do arrays allow us to do?

The Array object lets you store multiple values in a single variable.

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

The first element is in index 0.

1 Like
  1. Arrays allow us to store multiple values of the same type in a single variable.

  2. The index you should use in order to access the first element in an array is yourArray[0]

1 Like

What do arrays allow us to do?
The Array object lets you store multiple values in a single variable. It stores a fixed-size sequential collection of elements of the same type. 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?
indexOf()
Returns the first (least) index of an element within the array equal to the specified value, or -1 if none is found.

2 Likes
  1. What do arrays allow us to do?
    The Array object lets you store multiple values in a single variable. It stores a fixed-size sequential collection of elements of the same type. 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.

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

1 Like

Array lets store multiple values in a single variable.
0

1 Like
  1. What do arrays allow us to do?
    An array object let 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], beacuse we always start with zero when it comes to counting.
1 Like
  1. What do arrays allow us to do?

Arrays allow us to store multiple values of the same kind 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 organize a list of similar strings by assigning them the same value.
  2. What index should you use in order to access the first element in an array?
    index 0 is used to indicate the first element in an array
1 Like

1.Arrays allow us to store multiple values in a single variable.
2.We should use the index [0] to access the first element in an array.

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

Arrays allow us to store multiple values in a single variable. Simply, a collection of variables of the same type.

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

The zero based index, [0].

2 Likes