Arrays Flashcards

1
Q

Get the value “Volvo” from the cars array and assign to a variable named x.

var cars = [“Saab”, “Volvo”, “BMW”];

A

let x = cars[1];

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Change the first item of cars to “Ford”.

var cars = [“Volvo”, “Jeep”, “Mercedes”];

A

cars[0] = “Ford”;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Alert the number of items in an array, using the correct Array property.

var cars = [“Volvo”, “Jeep”, “Mercedes”];

A

alert(cars.length);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly