Chapter 3 Flashcards
T/F You can think of an array as a collection of variables contained within a single variable
True
T/F You access an array element’s value just as you access the value of any other variable, except that you must include the element index in brackets
True
T/F An if statement keeps repeating until its conditional expression evaluates to false
True
T/F Case labels must be discrete values and cannot use operators
True
T/F A break statement restarts a loop with a new iteration
False
You use a(n) BLANK when you want to store a group or a list of related information in a single, easily managed location
array
Each piece of data contained in an array is called a(n) BLANK
element
The BLANK statement is used to execute specific programming code if the evaluation of a conditional expression returns a truthy value
if
A set of statements contained within a set of braces is known as a(n) BLANK block
command
If you want to execute one set of statements when a condition evaluates to a truthy value and another set of statements when the condition evaluates to a falsy value, you need the BLANK statement
if/else
The BLANK statement controls program flow by executing a specific set of statements, depending on the value of an expression
switch
A(n) BLANK 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 statement’s expression
case
A case label consists of the keyword case, followed by a literal value or variable name, followed by a(n) BLANK
colon
The BLANK label contains statements that execute when the value returned by the switch statement does not match a case label
default
A(n) BLANK statement is used to end the execution of a switch statement
break
The conditional expression in the while statement is enclosed within BLANK following the keyword while
parentheses
A BLANK statement is a control flow statement that repeatedly executes a statement or series of statements while the value of a specific condition is truthy or until the value of a specific condition becomes truthy
loop
One of the simplest types of loops statements is the BLANK statement, which repeats a statement or series of statements as long as a given conditional expression evaluates to a truthy value
while
Each repetition of a looping statement is called a(n) BLANK
iteration
Unlike the while statement, the statements in a(n) BLANK statement always executes once, before a conditional expression is evaluated
do/while
The BLANK statement is used to repeat a statement or series of statements as long as a given conditional expression evaluates to a truthy value
for
A(n) BLANK statement restarts a loop with a new iteration
continue
A single statement that declares a variable and specifies array values as its content is called a(n) BLANK
array literal
Changing the order in which JavaScript code is executed is known as
controlling flow