Arrays - Reading Assignment

  1. What do arrays allow us to do?
    Arrays allow us to store multiple values of the same type in a single variable.

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

1 Like
  1. Lets you store multiple values in a single variable. This will allow you to call items from a list with a multitude of keywords.

  2. indexOf() will allow you to call the first element in the array.

1 Like

1.The Arrays allow to put one or more than one integer or script inside a variable EXP: var animal= new Array(“Mammoth”," Rhinoceros", “Parrot”);

  1. The first element of the array is always on the most left side of the arrays and the number attributed to it is 0 to have access just use the index number zero ,to use the index call the variable value and put the number between two parentheses EXP: animal[0];
2 Likes
  1. The array object lets you store multiple values in a single variable.

  2. indexOf() lets us access the first element in an array.

1 Like

What do arrays allow us to do?
Allows us to story multiple values in a single variable.

What index should I use in order to access the first element in an array?
0, because it is the first position of an array.

1 Like
  1. An array allows us to store a collection of variables of the same type.
  2. To access the first element in an array, by calling the index [0]
1 Like

1. What do arrays allow us to do?
To assign and store multiple values to a variable.

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

1 Like
  1. Arrays allow us to store multiple values in a single variable.
  2. To access the first element in an array you need to use 0.
1 Like
  1. What do arrays allow us to do?
    Arrays let you store multiple values within a single variable.

  2. What index should you use in order to access the first element in an array?
    Let’s say you have var colors = [“blue”, “green”, “yellow”];
    To access the first element, which is blue, you use index 0, cause in programming, you always begin the count at 0.

1 Like
  1. Arrays allow us to store many variables of the same data type.
  2. Array(0)
1 Like
  1. What do arrays allow us to do?
    Array object allows you store multiple values in a single variable.

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

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

Arrays allow you to store multiple values in a single variable. It allows us to act upon a collection of variables of the same type when programming.

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

Arrays use 0 index to access 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. 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 in an array variable always start at 0. So 0= 1, 1=2, 2= 3, 3= 4 etc.
1 Like
  1. It allows to store a number of values in just a single variable. You could also say that it is a collection of data that is stored. For example;

var vegetables = new array(“cucumber”, “cauliflower”, “spinach”);

  1. The array begins it counting from 0 and so the first value/element you would use is 0. This type of index that arrays use is called ‘ordinal numbers’. Here is an example;

vegetables[0] is the first element
vegetables[1] is the 2nd element
vegetables[2] is the 3rd element
and so on…

1 Like

1 - Arrays are used to store multiple values in a single variable, instead of declaring separate variables for each value
2 - The first element of an array is at index 0

1 Like
  1. 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.
  1. What index should you use in order to access the first element in an array?
  • 0
1 Like
  1. store multiple values in a single variable.
  2. index 0
1 Like

1: An Array object allows you to store multiple values in a single variable.

2: The first element will be index 0.

var sauce = [‘ketchup’, ‘garlic’, ‘mayonaise’];
sauce.indexOf(‘ketchup’)

// -> 0

1 Like
  1. What do arrays allow us to do?
    Arrays allow us to store multiple values in a single variable by storing a fixed-size sequential collection of elements of the same type.

  2. What index should you use in order to access the first element in an array?
    Array index at Zero, so we should use 0 index to access the first element of an array

1 Like
  1. Arrays let us store multiple values of the same type within a single variable. It is used to store a collection of data.

  2. The first element of an array will be at index 0.

1 Like