Module 09 - Arrays Flashcards

1
Q

What is array idioms?

A

A common or accepting way of expressing a particular idea or pattern in a code

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

What happens when you initialize an array?

A

You define its size and provide initial values for its elements

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

What is an array?

A

An array is like a list where you can store multiple items of the same type, such as numbers or strings, under a single name.

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

Values in an array are ordered in sequence. T or F

A

True

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

Each value stored in an array is called ‘component’. T or F

A

False. It’s element

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

Does every array have a name?

A

Yes

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

Each element is accessed through a unique index. T or F

A

True

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

Index is not a whole number starting from 0

A

False

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

What is a button variable?

A

Refers to a bundle of information within a single variable

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

What is dot notation?

A

To access properties of an object

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

How do you use dot notation?

A

Use the name of the variable, followed by a dot, followed by a field name

Example: text(button.label, textX, textY);

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

When counting elements in an array, what do you start with?

A

Always starts at 0 through 1

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

What does updating an array mean?

A

Means to modify the values stored in an array

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

How do you change the value of an element in an array?

A

You specify it

Example: let colour = [“brown”, white”, “blue”, “green”, “red”];

CHANGE INSTRUCT: colour[2] = “pink”

NOW: let colour = [“brown”, “white”, “pink”, “green”, “red”];

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