Deck 3: Building Arrays and Controlling Flow

ملء الشاشة (f)
exit full mode
سؤال
You use a(n)____ when  you want to store a group or a list of related information in a single, easily managed location.

A) function
B) console
C) array
D) conditional statement
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
The conditional expression in the   while  statement  is enclosed within ____ following the keyword while .

A) slashes
B) parentheses
C) asterisks
D) dashes
سؤال
A set of statements contained within a set of braces is known as a(n)____ block.

A) reference
B) instance
C) object
D) command
سؤال
A(n)____ 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.

A) if
B) default
C) case
D) break
سؤال
A break statement restarts a loop with a new iteration.
سؤال
A(n)____ statement is used to end the execution of a switch statement.

A) else
B) continue
C) break
D) default
سؤال
You access an array element's value just as you access the value of any other variable, except that  you include the element index in brackets.
سؤال
Case labels must be discrete values and cannot use operators.
سؤال
The ____ statement controls program flow by executing a specific set of statements, depending on the value of an expression.

A) if
B) while
C) if...else
D) switch
سؤال
Each piece of data contained in an array is called a(n)____.

A) index
B) range
C) element
D) column
سؤال
The ____ statement is used to execute specific programming code if the evaluation of a conditional expression returns a truthy value.

A) default
B) continue
C) break
D) if
سؤال
Unlike the while statement, the statements in a ____  statement always execute once, before a conditional expression is evaluated.

A) do/continue
B) do/while
C) do/until
D) do/using
سؤال
An if statement keeps repeating until its conditional expression evaluates to false.
سؤال
Each repetition of a looping statement is called a(n)____.

A) case
B) element
C) iteration
D) condition
سؤال
A case label consists of the keyword case , followed by a literal value or variable name, followed by a ____.

A) semicolon
B) colon
C) period
D) comma
سؤال
The ____ label contains statements that execute when the value returned by the switch statement expression does not match a case label.

A) default
B) else
C) break
D) continue
سؤال
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 ____ statement.

A) while
B) if/else
C) do/while
D) switch
سؤال
A ____ statement is a  a control flow statement that repeatedly executes a statement or a series   of statements while the value of a specific condition is truthy or until the value of a specific  condition becomes truthy .

A) decision-making
B) fork
C) break
D) loop
سؤال
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 evaluates to a truthy value.

A) continue
B) while
C) switch
D) if
سؤال
You can think of an array as a collection of variables contained within a single variable.
سؤال
Match between columns
Compares the value of an expression to a value contained within a special statement called a case label
array literal
Compares the value of an expression to a value contained within a special statement called a case label
array
Compares the value of an expression to a value contained within a special statement called a case label
index
Compares the value of an expression to a value contained within a special statement called a case label
length property
Compares the value of an expression to a value contained within a special statement called a case label
if statement
Compares the value of an expression to a value contained within a special statement called a case label
command block
Compares the value of an expression to a value contained within a special statement called a case label
controlling flow
Compares the value of an expression to a value contained within a special statement called a case label
switch statement
Compares the value of an expression to a value contained within a special statement called a case label
counter
Contains a set of data represented by a single variable name
array literal
Contains a set of data represented by a single variable name
array
Contains a set of data represented by a single variable name
index
Contains a set of data represented by a single variable name
length property
Contains a set of data represented by a single variable name
if statement
Contains a set of data represented by a single variable name
command block
Contains a set of data represented by a single variable name
controlling flow
Contains a set of data represented by a single variable name
switch statement
Contains a set of data represented by a single variable name
counter
Returns the number of elements in an array
array literal
Returns the number of elements in an array
array
Returns the number of elements in an array
index
Returns the number of elements in an array
length property
Returns the number of elements in an array
if statement
Returns the number of elements in an array
command block
Returns the number of elements in an array
controlling flow
Returns the number of elements in an array
switch statement
Returns the number of elements in an array
counter
A single statement that declares a variable and specifies array values as its content
array literal
A single statement that declares a variable and specifies array values as its content
array
A single statement that declares a variable and specifies array values as its content
index
A single statement that declares a variable and specifies array values as its content
length property
A single statement that declares a variable and specifies array values as its content
if statement
A single statement that declares a variable and specifies array values as its content
command block
A single statement that declares a variable and specifies array values as its content
controlling flow
A single statement that declares a variable and specifies array values as its content
switch statement
A single statement that declares a variable and specifies array values as its content
counter
Changing the order in which JavaScript code is executed
array literal
Changing the order in which JavaScript code is executed
array
Changing the order in which JavaScript code is executed
index
Changing the order in which JavaScript code is executed
length property
Changing the order in which JavaScript code is executed
if statement
Changing the order in which JavaScript code is executed
command block
Changing the order in which JavaScript code is executed
controlling flow
Changing the order in which JavaScript code is executed
switch statement
Changing the order in which JavaScript code is executed
counter
A set of statements contained within a set of braces
array literal
A set of statements contained within a set of braces
array
A set of statements contained within a set of braces
index
A set of statements contained within a set of braces
length property
A set of statements contained within a set of braces
if statement
A set of statements contained within a set of braces
command block
A set of statements contained within a set of braces
controlling flow
A set of statements contained within a set of braces
switch statement
A set of statements contained within a set of braces
counter
An element's numeric position within an array
array literal
An element's numeric position within an array
array
An element's numeric position within an array
index
An element's numeric position within an array
length property
An element's numeric position within an array
if statement
An element's numeric position within an array
command block
An element's numeric position within an array
controlling flow
An element's numeric position within an array
switch statement
An element's numeric position within an array
counter
The most common type of decision-making statement
array literal
The most common type of decision-making statement
array
The most common type of decision-making statement
index
The most common type of decision-making statement
length property
The most common type of decision-making statement
if statement
The most common type of decision-making statement
command block
The most common type of decision-making statement
controlling flow
The most common type of decision-making statement
switch statement
The most common type of decision-making statement
counter
A variable that is incremented or decremented with each iteration of a loop statement
array literal
A variable that is incremented or decremented with each iteration of a loop statement
array
A variable that is incremented or decremented with each iteration of a loop statement
index
A variable that is incremented or decremented with each iteration of a loop statement
length property
A variable that is incremented or decremented with each iteration of a loop statement
if statement
A variable that is incremented or decremented with each iteration of a loop statement
command block
A variable that is incremented or decremented with each iteration of a loop statement
controlling flow
A variable that is incremented or decremented with each iteration of a loop statement
switch statement
A variable that is incremented or decremented with each iteration of a loop statement
counter
سؤال
Which method  returns a collection of references to all instances of  a certain element in an HTML document?

A)getElementById()
B) getElementsByName()
C)getElementsByTagName()
D)getElementsByClassName()
سؤال
What is the difference between an if statement and an if/else statement?
سؤال
What is the difference between the while and  do/while statements?
سؤال
What is a counter, and how is it used in programming?
سؤال
Each repetition of a looping statement is called a(n)____________________ .
سؤال
How is a for statement different from a while statement?
سؤال
The ____ statement is used to repeat a statement or series of statements as long as a given conditional expression evaluates to a truthy value.

A) for
B) continue
C) default
D) switch
سؤال
A single statement that declares a variable and specifies array values as its content is called an array ____.

A)index
B)element
C)constructor
D)literal
سؤال
A ____ statement restarts a loop with a new iteration.

A) break
B) continue
C) next
D) default
سؤال
To end a switch statement once it performs its required task, include a(n)____________________ statement at the end of the statements associated with each case label.
سؤال
Which of the following references the second element in the newsSections array?

A) newsSections[1]
B)newsSections[2]
C)newsSections(1)
D) newsSections(2)
سؤال
Changing the order in which JavaScript code is executed is known as  ____________________.
سؤال
Placing one decision-making statement within another decision-making statement creates  a(n)____________________  decision-making structure .
سؤال
Explain how to use an array literal to declare an array.
سؤال
In a(n)____________________ loop, a loop statement never ends because its conditional expression is never falsy.
سؤال
Define decision making and describe its role in programming.
سؤال
Describe the four steps that occur when a JavaScript interpreter encounters a for statement.
سؤال
What are loop statements used for in programming?
سؤال
Explain how index numbers are assigned to array elements and give an example.
سؤال
Explain what fallthrough is and how to prevent it.
سؤال
Explain how you access an element's value in an array.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/42
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 3: Building Arrays and Controlling Flow
1
You use a(n)____ when  you want to store a group or a list of related information in a single, easily managed location.

A) function
B) console
C) array
D) conditional statement
C
2
The conditional expression in the   while  statement  is enclosed within ____ following the keyword while .

A) slashes
B) parentheses
C) asterisks
D) dashes
B
3
A set of statements contained within a set of braces is known as a(n)____ block.

A) reference
B) instance
C) object
D) command
D
4
A(n)____ 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.

A) if
B) default
C) case
D) break
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
5
A break statement restarts a loop with a new iteration.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
6
A(n)____ statement is used to end the execution of a switch statement.

A) else
B) continue
C) break
D) default
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
7
You access an array element's value just as you access the value of any other variable, except that  you include the element index in brackets.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
8
Case labels must be discrete values and cannot use operators.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
9
The ____ statement controls program flow by executing a specific set of statements, depending on the value of an expression.

A) if
B) while
C) if...else
D) switch
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
10
Each piece of data contained in an array is called a(n)____.

A) index
B) range
C) element
D) column
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
11
The ____ statement is used to execute specific programming code if the evaluation of a conditional expression returns a truthy value.

A) default
B) continue
C) break
D) if
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
12
Unlike the while statement, the statements in a ____  statement always execute once, before a conditional expression is evaluated.

A) do/continue
B) do/while
C) do/until
D) do/using
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
13
An if statement keeps repeating until its conditional expression evaluates to false.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
14
Each repetition of a looping statement is called a(n)____.

A) case
B) element
C) iteration
D) condition
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
15
A case label consists of the keyword case , followed by a literal value or variable name, followed by a ____.

A) semicolon
B) colon
C) period
D) comma
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
16
The ____ label contains statements that execute when the value returned by the switch statement expression does not match a case label.

A) default
B) else
C) break
D) continue
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
17
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 ____ statement.

A) while
B) if/else
C) do/while
D) switch
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
18
A ____ statement is a  a control flow statement that repeatedly executes a statement or a series   of statements while the value of a specific condition is truthy or until the value of a specific  condition becomes truthy .

A) decision-making
B) fork
C) break
D) loop
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
19
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 evaluates to a truthy value.

A) continue
B) while
C) switch
D) if
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
20
You can think of an array as a collection of variables contained within a single variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
21
Match between columns
Compares the value of an expression to a value contained within a special statement called a case label
array literal
Compares the value of an expression to a value contained within a special statement called a case label
array
Compares the value of an expression to a value contained within a special statement called a case label
index
Compares the value of an expression to a value contained within a special statement called a case label
length property
Compares the value of an expression to a value contained within a special statement called a case label
if statement
Compares the value of an expression to a value contained within a special statement called a case label
command block
Compares the value of an expression to a value contained within a special statement called a case label
controlling flow
Compares the value of an expression to a value contained within a special statement called a case label
switch statement
Compares the value of an expression to a value contained within a special statement called a case label
counter
Contains a set of data represented by a single variable name
array literal
Contains a set of data represented by a single variable name
array
Contains a set of data represented by a single variable name
index
Contains a set of data represented by a single variable name
length property
Contains a set of data represented by a single variable name
if statement
Contains a set of data represented by a single variable name
command block
Contains a set of data represented by a single variable name
controlling flow
Contains a set of data represented by a single variable name
switch statement
Contains a set of data represented by a single variable name
counter
Returns the number of elements in an array
array literal
Returns the number of elements in an array
array
Returns the number of elements in an array
index
Returns the number of elements in an array
length property
Returns the number of elements in an array
if statement
Returns the number of elements in an array
command block
Returns the number of elements in an array
controlling flow
Returns the number of elements in an array
switch statement
Returns the number of elements in an array
counter
A single statement that declares a variable and specifies array values as its content
array literal
A single statement that declares a variable and specifies array values as its content
array
A single statement that declares a variable and specifies array values as its content
index
A single statement that declares a variable and specifies array values as its content
length property
A single statement that declares a variable and specifies array values as its content
if statement
A single statement that declares a variable and specifies array values as its content
command block
A single statement that declares a variable and specifies array values as its content
controlling flow
A single statement that declares a variable and specifies array values as its content
switch statement
A single statement that declares a variable and specifies array values as its content
counter
Changing the order in which JavaScript code is executed
array literal
Changing the order in which JavaScript code is executed
array
Changing the order in which JavaScript code is executed
index
Changing the order in which JavaScript code is executed
length property
Changing the order in which JavaScript code is executed
if statement
Changing the order in which JavaScript code is executed
command block
Changing the order in which JavaScript code is executed
controlling flow
Changing the order in which JavaScript code is executed
switch statement
Changing the order in which JavaScript code is executed
counter
A set of statements contained within a set of braces
array literal
A set of statements contained within a set of braces
array
A set of statements contained within a set of braces
index
A set of statements contained within a set of braces
length property
A set of statements contained within a set of braces
if statement
A set of statements contained within a set of braces
command block
A set of statements contained within a set of braces
controlling flow
A set of statements contained within a set of braces
switch statement
A set of statements contained within a set of braces
counter
An element's numeric position within an array
array literal
An element's numeric position within an array
array
An element's numeric position within an array
index
An element's numeric position within an array
length property
An element's numeric position within an array
if statement
An element's numeric position within an array
command block
An element's numeric position within an array
controlling flow
An element's numeric position within an array
switch statement
An element's numeric position within an array
counter
The most common type of decision-making statement
array literal
The most common type of decision-making statement
array
The most common type of decision-making statement
index
The most common type of decision-making statement
length property
The most common type of decision-making statement
if statement
The most common type of decision-making statement
command block
The most common type of decision-making statement
controlling flow
The most common type of decision-making statement
switch statement
The most common type of decision-making statement
counter
A variable that is incremented or decremented with each iteration of a loop statement
array literal
A variable that is incremented or decremented with each iteration of a loop statement
array
A variable that is incremented or decremented with each iteration of a loop statement
index
A variable that is incremented or decremented with each iteration of a loop statement
length property
A variable that is incremented or decremented with each iteration of a loop statement
if statement
A variable that is incremented or decremented with each iteration of a loop statement
command block
A variable that is incremented or decremented with each iteration of a loop statement
controlling flow
A variable that is incremented or decremented with each iteration of a loop statement
switch statement
A variable that is incremented or decremented with each iteration of a loop statement
counter
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
22
Which method  returns a collection of references to all instances of  a certain element in an HTML document?

A)getElementById()
B) getElementsByName()
C)getElementsByTagName()
D)getElementsByClassName()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
23
What is the difference between an if statement and an if/else statement?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
24
What is the difference between the while and  do/while statements?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
25
What is a counter, and how is it used in programming?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
26
Each repetition of a looping statement is called a(n)____________________ .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
27
How is a for statement different from a while statement?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
28
The ____ statement is used to repeat a statement or series of statements as long as a given conditional expression evaluates to a truthy value.

A) for
B) continue
C) default
D) switch
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
29
A single statement that declares a variable and specifies array values as its content is called an array ____.

A)index
B)element
C)constructor
D)literal
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
30
A ____ statement restarts a loop with a new iteration.

A) break
B) continue
C) next
D) default
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
31
To end a switch statement once it performs its required task, include a(n)____________________ statement at the end of the statements associated with each case label.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
32
Which of the following references the second element in the newsSections array?

A) newsSections[1]
B)newsSections[2]
C)newsSections(1)
D) newsSections(2)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
33
Changing the order in which JavaScript code is executed is known as  ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
34
Placing one decision-making statement within another decision-making statement creates  a(n)____________________  decision-making structure .
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
35
Explain how to use an array literal to declare an array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
36
In a(n)____________________ loop, a loop statement never ends because its conditional expression is never falsy.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
37
Define decision making and describe its role in programming.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
38
Describe the four steps that occur when a JavaScript interpreter encounters a for statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
39
What are loop statements used for in programming?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
40
Explain how index numbers are assigned to array elements and give an example.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
41
Explain what fallthrough is and how to prevent it.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
42
Explain how you access an element's value in an array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 42 في هذه المجموعة.