Chapter 3- arrays Flashcards

1
Q

You can think of an array as a collection of variables contained within a single variable

A

True

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

You access an arrays elements value just as you access the value of any other variable except that you include the element index in brackets

A

True

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

An if statement keeps repeating until it’s conditional expression evaluated to false

A

False

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

Case labels must be discrete values and cannot use operators

A

True

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

A break statement restarts a loop with a new iteration.

A

False

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

You use a ____ when you want to store a group or a list of related information in a single, easily managed location

A

Array

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

Each piece of data contained in an array is called an __

A

Element

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

The _ statement is used to execute specific programming code if the evaluation of a conditional expression returns a truthy value

A

If

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

A set of statements contained within a set of braces is known as ___ block

A

Command

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

If you want to execute one set of statements when a condition evaluated to a truthy value and another set of statements when the condition evaluated to a falsy value, you need the _ statement

A

If/else

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

The _ statement controls program flow by executing a specific set of statements, depending on the value of an expression

A

Switch

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

A _ label in a switch statement represents a specific value and is followed by one or more statements that are executed if the value of the label matches the value of the switch statements expression

A

Case

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

A case label consists of the keyword case, followed by a literal value or variable name, followed by a _

A

Colon

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

The _ label contains statements that execute when the value returned by the switch statement expression does not match a case label

A

Default

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

A _ statement is used to end the execution of a switch statement

A

Break

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

The conditional expression in the whole statement is enclosed within _ following the keyword while

A

Parentheses

17
Q

A _ statement is a control flow statement that repeatedly executed a statement or a series of statements that while the value of a specific condition is truthy or until the value of a specific condition becomes truthy

A

Loop

18
Q

One of the simplest types of loop statements is the _ statement which repeats a statement or series of statements as long as a given conditional expression evaluated to a truthy value

A

If

19
Q

Each repetition of a looping statement is called a _

A

Iteration

20
Q

Unlike the while statement the statements in a _ statement always execute once, before a conditional expression is evaluated

A

Do/while

21
Q

The _ statement is used to repeat a statement or series of statements as long as a given conditional expression evaluated to a truthy value

A

For

22
Q

A _ statement restarts a loop with a new iteration

A

Continue

23
Q

A single statement that declares a variable and specifies array values as its content is called an array _

A

Literal

24
Q

Which of the following references the second element in the newSections array?

A

newsSections[1]

25
Q

Which method returns a collection of references to all instances of a certain element in an HTML document?

A

getElementsByTagName()

26
Q

Changing the order in which a JavaScript code is executed is known as _

A

Controlling flow

27
Q

To end a switch statement once it performs its required task, include a _ statement at the end of the statements associated with each case label

A

Break

28
Q

In a _ loop, a loop statement never ends because it’s conditional expression is never falsy

A

Infinite

29
Q

Each repetition of a looping statement is called a _

A

Iteration

30
Q

Placing one decision making statement within another decision making statement creates a _ decision making structure

A

nested