javascript-reference-data-types-2 Flashcards

1
Q

What is an array in JavaScript?

A

Object lets you store multiple values in a single variable.

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

How do you create an array literal?

A

create a variable and then use [] brackets to list array within brackets in quotations
ex:
var colors
colors[“blue”, “green”]

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

What are the keys for the values inside an array?

A

the name for each element within the array?

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

Arrays have a property named length. Because arrays have a properties, what other data structure are they similar to?

A

Objects.

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