JS arrays Flashcards

1
Q

What are arrays used for?

A

they are used when working with a list of values related to each other

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

Describe array literal notation

A

var array = [string, boolean, function, objects, number]

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

How are arrays different from “plain” objects?

A

arrays are in an ordered collection, and each item in the array is accessed thru its index

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

What number represents the first index of an array?

A

zero

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

What is the length property of an array?

A

returns the number of elements in an array

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

How do you calculate the last index of an array?

A

lastIndex = array.length - 1

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