Deck 10: Exploring Arrays, loops, and Conditional Statements

ملء الشاشة (f)
exit full mode
سؤال
Statement labels are used to identify statements in JavaScript code so that the statements can be referenced elsewhere in a program.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
When each entry in an array matches the entry in another array,it is called a linear array.
سؤال
In an array literal,the array values are a space-separated list within a set of curly brackets.
سؤال
Index values start with 1 so that the initial item in an array has an index value of 1,the second item has an index value of 2,and so on.
سؤال
The break statement runs a command or a command block only if the conditional expression returns the value true; it does nothing if the condition is false.
سؤال
The do/while loop is generally used when the program loop should run at least once before testing for the stopping condition.
سؤال
A calendar that is created as a web table can have class and ID designations to make it easy for page developers to assign different styles to different parts of the calendar.
سؤال
In an if loop,a variable known as a counter variable is used to track the number of times a block of commands is run.
سؤال
Increasing the value of the length property adds more items to an array,but the items have null values until they are defined.
سؤال
JavaScript supports logical operators that connect several expressions.
سؤال
The appearance of any form element can be changed by modifying style sheets instead of the JavaScript code.
سؤال
The every(callback [,thisArg])array method applies the callback function to each item in an array.
سؤال
The value of the length property can be reduced without removing items from an array.
سؤال
By default,items are placed in an array either in the order in which they are defined or explicitly by index number.
سؤال
The getDate()method in a calendar app returns an integer ranging from 0 (Sunday)to 6 (Saturday).
سؤال
When a pass statement is encountered,control is passed to the statement immediately following it.
سؤال
A command block is indicated by its opening and closing square brackets [ ].
سؤال
The map(callback [,thisArg])method returns the index of the first element in the array that passes a test in the callback function.
سؤال
The slice()method reverses the order of items in an array,making the last items first and the first items last.
سؤال
The while statement is used to exit a program loop before the stopping condition is met.
سؤال
What is the output of the following code?
Var x = ["a","b","c"];
X)push("d","e");
X)pop();
X)pop();

A) ​x = ["a","b","c"]
B) ​x = ["a","b","d","e"]
C) ​x = ["d","e"]
D) ​x = ["c","d","e"]
سؤال
Identify the general syntax of the do/while loop.

A) do (continue){
Commands
}
While (continue){
Commands
}
B) while (continue){
Commands
}
Do (continue){
Commands
}
C) while {
Commands
}
Do (continue);
D) do {
Commands
}
While (continue);
سؤال
Identify the general structure of a for loop.

A) for (start;continue;update)
{
Commands
}
B) ​for (start;update)
{
Commands
}
C) ​for (start;stop)
{
Commands
}
D) ​for (start;stop;continue)
{
Commands
}
سؤال
Which of the following determines the current size of an array?

A) ​array(length)
B) ​array[length]
C) ​array.length
D) ​array::length
سؤال
Identify a method that is used to create a subarray.

A) ​concat()
B) ​slice()
C) ​assert()
D) ​sort()
سؤال
Numeric data can be sorted by creating a(n)_____ function that contrasts the values of two adjacent array items.

A) ​sum
B) ​iteration
C) ​assert
D) ​compare
سؤال
Identify the syntax of the while loop.

A) while (continue){
Commands
}
B) while (start){
Commands
}
C) while [start;stop] {
Commands
}
D) while [update;continue] {
Commands
}
سؤال
A _____,which employs the first-in-first-out (FIFO)principle in which the first item added to the data list is the first removed,is similar to a stack.

A) ​frame
B) ​bitmap
C) ​queue
D) ​binary tree
سؤال
What is the output of the following code?
For (var i = 0; i < = 360; i+=60)

A) ​i = 0,60,120,180,240,360
B) ​i = 360,240,180,120,60,0
C) ​i = 60,120,240,480,960
D) ​i = 600,300,240,180,120,60
سؤال
Identify a method that inserts new items at the front of an array.

A) ​reverse()
B) ​unshift()
C) ​assert()
D) ​sort()
سؤال
The _____ loop tests the condition to continue the loop right after the latest command block is run.

A) ​do/while
B) ​while
C) ​for
D) ​forEach
سؤال
Identify the output of the following code.
Var x = [3,45,1234,24];
X)sort();

A) ​1234,24,3,45
B) ​3,24,45,1234
C) ​1234,45,24,3
D) ​1234,24,45
سؤال
Identify a compare function that sorts numeric values in ascending order.

A) ​function ascending(a,b){
Return a - b;
}
B) ​function ascending(b,a){
Return a;
}
C) ​function ascending(a,b){
Return b - a;
}
D) ​function ascending(b,a){
Return b;
}
سؤال
Identify the expression used to reference array values.

A) ​array()
B) ​array[i]
C) ​array{array1,array2,…}
D) ​array::values
سؤال
Which of the following examples tests whether x is equal to 5 or y is equal to 8?

A) ​(x === 5)&& (y === 8)
B) ​(x === 5): (y === 8)
C) ​(x === 5)|| (y === 8)
D) ​(x === 5)/ (y === 8)
سؤال
For array data that should be treated as a queue,the _____ method is used,which is similar to the pop()method except that it removes the first array item and not the last.

A) ​reverse()
B) ​shift()
C) ​assert()
D) ​sort()
سؤال
Identify a compare function that sorts numeric values in descending order.

A) function descending(a,b){
Return a - b;
}
B) function descending(b,a){
Return b;
}

C) function descending(a,b){
Return b - a;
}
D) function descending(b,a){
Return a;
}
سؤال
The _____ operator tests whether two items are equal in value and have the same data type.

A) ​= =
B) ​= = =
C) ​=
D) ​!=
سؤال
A(n)_____ is a collection of values organized under a single name.

A) ​index
B) ​heap
C) ​array
D) ​tuple
سؤال
What is the output of the following code?
For(var i = 5; i > 0; i--)

A) ​i = 4,3,2,1,0
B) ​i = 5,4,3,2,1
C) ​i = 0,1,2,3,4
D) ​i = 1,2,3,4,5
سؤال
The _____ method creates a new array by passing the original array items to the callback function,which returns the equivalent value of the array items.

A) ​array.every(callback [,thisArg])
B) ​array.map(callback [,thisArg])
C) ​array.some(callback [,thisArg])
D) ​array.find(callback [,thisArg])
سؤال
Identify a true statement of array.some(callback [,thisArg])method.

A) ​It tests whether the condition returned by the callback function holds for at least one item in array.
B) ​It returns the value of the first element in the array that passes a test in the callback function.
C) ​It tests whether the condition returned by the callback function holds for all items in array.
D) ​It returns the index of the first element in the array that passes a test in the callback function.
سؤال
The _____ method diminishes array from the last element by keeping only those items that return a value of true from the callback function.

A) ​array.every(callback [,thisArg])
B) ​array.map(callback [,thisArg])
C) ​array.reduceRight(callback [,thisArg])
D) ​array.findIndex(callback [,thisArg])
سؤال
Identify the expression in which the initial value of the day variable will be set to match the first day of the calendar month.

A) ​var day = Date(calDate(),calDate.getDay(),1);
B) ​var day = new Day(calDate.getDD(),calDate.getMM(),calDate.getYY(),1);
C) ​var day = new Day(calDay.getFullMonth(),calDay.getDate(),1);
D) ​var day = new Date(calDate.getFullYear(),calDate.getMonth(),1);
سؤال
The _____ method performs an action similar to the forEach()method except that the function it calls returns a value that can be used to match the contents of an existing array into a new array.

A) ​sort()
B) ​map()
C) ​splice()
D) ​find()
سؤال
Which of the following statements is used to terminate any program loop or conditional statement?

A) ​for
B) ​while
C) ​pass
D) ​break
سؤال
Identify the general syntax of the forEach method.

A) array.forEach [,thisArg](){
Commands
}
B) ​array.forEach(callback [,thisArg])
C) array.forEach (value){
Commands
}
D) ​array.forEach(callback [value])
سؤال
What is the output of the following code?
Var scores = [92,68,83,95,91,65,77];
Var highScores = scores.filter(gradeA);
Function gradeA(value){
Return value > 90;
}

A) ​[92,95,91]
B) ​[96,97,98]
C) ​[68,83,65,77]
D) ​[91,92,65,68,77,83]
سؤال
What is the output of the following code?
Var x = [4,7,11];
X)forEach(stepUp);
Function stepUp(value,i,arr){
Arr[i] = value + 1;
}

A) ​4,7,11
B) ​3,7,11
C) ​5,8,12
D) ​8,14,22
سؤال
Which of the following methods is used to determine the day of the week on which a month starts?

A) ​calDay;
B) ​day.calDay()
C) ​find.Day;
D) ​getDay()
سؤال
Identify a method that tests whether the condition returned by the callback function holds for all items in an array.

A) ​array.every(callback [,thisArg])
B) ​array.filter(callback [,thisArg])
C) ​array.some(callback [,thisArg])
D) ​array.find(callback [,thisArg])
سؤال
What is the output of the following code?
Var sum = 0;
Var x = [1,3,7,11];
X)forEach(sumArray);
Function sumArray(value){
Sum += value;
}

A) ​0
B) ​231
C) ​11
D) ​22
سؤال
Identify a true statement of array.find(callback [,thisArg])method.

A) ​It tests whether the condition returned by the callback function holds for at least one item in array.
B) ​It returns the value of the first element in the array that passes a test in the callback function.
C) ​It tests whether the condition returned by the callback function holds for all items in array.
D) ​It returns the index of the first element in the array that passes a test in the callback function.
سؤال
Identify a method that decreases array by keeping only those items that return a value of true from the callback function.

A) ​array.every(callback [,thisArg])
B) ​array.map(callback [,thisArg])
C) ​array.reduce(callback [,thisArg])
D) ​array.find(callback [,thisArg])
سؤال
Which of the following functions increases the value of each item in an array by 1?

A) ​sum()
B) ​AddArray()
C) ​StepUp()
D) ​ceil()
سؤال
Which of the following values will the expression 15 % 4 return?

A) ​1
B) ​11
C) ​3
D) ​60
سؤال
Identify the structure of an if statement

A) if (condition){
Commands
}
B) ​if {
}(condition)
C) if {
Commands
}
D) ​if {
}
(condition){
Commands
سؤال
Identify the general structure for accessing each value from an array using a for loop.

A) ​for (i < array; i++){
Commands involving array[i]
}
B) for (var i = 0; i++; i < array.length){
Commands involving array(i)
}
C) for (var i = 0; i++){
Commands involving array(i)
}
D) for (var i = 0; i < array.length; i++){
Commands involving array[i]
}
سؤال
Identify a method that extracts array items that match a specified condition.

A) ​sort()
B) ​filter()
C) ​splice()
D) ​reverse()
سؤال
Which of the following methods creates a new array populated with the elements of array that return a value of true from the callback function?

A) ​array.every(callback [,thisArg])
B) ​array.filter(callback [,thisArg])
C) ​array.some(callback [,thisArg])
D) ​array.find(callback [,thisArg])
سؤال
Melissa, a computer science engineering student, is learning the basics of programming by exploring arrays. She learns about different array methods. She wishes to learn more on inserting and deleting array items. She creates monthName array to extract only the three spring months—March, April, and May—from a calendar.

-Melissa wants to insert abbreviations of spring months into the monthName array.Which of the following methods should she use?

A) monthName.reverse(5,3,"Mar","Apr","May");
B) monthName.sort(2,3,"Mar","Apr","May");
C) monthName.join(5,3,"Mar","Apr","May");
D) monthName.splice(2,3,"Mar","Apr","May");
سؤال

Identify the letter of the choice that best matches the phrase or definition.

-This method inverts the order of items in an array.

A) array.unshift(values)
B) array.toString()
C) pop()
D) concat(array1,array2,...)
E) sort()
F) copyWithin(target,start[,end])
G) join(separator)
H) shift()
I) reverse()
J)push(values)
سؤال
JavaScript allows for the creation of _________,in which some array values are undefined.
سؤال
A _________ is an operator that compares the value of one expression to another returning a Boolean value indicating whether the comparison is true or not.
سؤال
The collection of commands that is run each time through a loop is known collectively as a _________.
سؤال
Gregor, a software developer, is developing a calendar application. He has to use several if conditional statements to ensure that the calendar displays the exact number of days present in each month of each year. He creates a dayCount array to keep track of the number of days in each month.

-Gregor wants to ensure February contains 29 days only in the year 2020 as it is a leap year.Which of the following should Gregor use to set the value in the dayCount array?

A) if (thisYear === 2020){
DayCount[1] = 29;
}
B) if (dayCount=29)
{
2020;
}
C) if {
ThisYear = 2020;
DayCount[1] == 29;
}
D) if {
DayCount=29 && this year=2020;
}
سؤال
_________ is a number associated with each individual value in an array and distinguishes each value from other values in the array.
سؤال
The _____ statement stops processing the commands in the current iteration of the loop and proceeds to the next iteration instead of stopping the program loop altogether.

A) ​switch
B) ​else
C) ​continue
D) ​pass
سؤال
Melissa, a computer science engineering student, is learning the basics of programming by exploring arrays. She learns about different array methods. She wishes to learn more on inserting and deleting array items. She creates monthName array to extract only the three spring months—March, April, and May—from a calendar.

-Melissa wants to remove spring months from the monthName array.Which of the following methods should Melissa use?

A) springMonths = monthName.slice(2,5);
B) springMonths = monthName.splice(2,3);
C) springMonths = monthName.slice(3,5);
D) springMonths = monthName.splice(5,3);
سؤال
A _________ is a set of commands executed repeatedly until a stopping condition is met.
سؤال

Identify the letter of the choice that best matches the phrase or definition.

-This method appends an array with new items.

A) array.unshift(values)
B) array.toString()
C) pop()
D) concat(array1,array2,...)
E) sort()
F) copyWithin(target,start[,end])
G) join(separator)
H) shift()
I) reverse()
J)push(values)
سؤال
Gregor, a software developer, is developing a calendar application. He has to use several if conditional statements to ensure that the calendar displays the exact number of days present in each month of each year. He creates a dayCount array to keep track of the number of days in each month.

-Gregor wants to create a condition to ensure that all the years divisible by 4 should contain 29 days in February.Which of the following statements should he use?

A) if (thisYear % 4 === 0){
DayCount[1] = 29;
}
B) if (this year/4 === 0){
DayCount[2] = 29;
}
C) if (this year*4==0){
DayCount[1] = 29
}
D) if (thisYear % 4 < = 29){
DayCount[2] = 29;
}
سؤال
_________ is a section of an array.
سؤال
A _________ is a statement that runs a command or command block only when certain circumstances are met.
سؤال
A stack data structure employs the _________ principle in which the last items added to the stack are the first ones removed.
سؤال

Identify the letter of the choice that best matches the phrase or definition.

-This method removes the last item from an array.

A) array.unshift(values)
B) array.toString()
C) pop()
D) concat(array1,array2,...)
E) sort()
F) copyWithin(target,start[,end])
G) join(separator)
H) shift()
I) reverse()
J)push(values)
سؤال
Identify the syntax of the statement label.

A) ​label = {statements}
B) ​statement!(label)
C) ​label: statements
D) ​statements.label
سؤال
Arrays can be used to store information in a data structure known as a _________ in which new items are added to the top or to the end of the array.
سؤال
The _________ returns the integer remainder after dividing one integer by another.
سؤال
Melissa, a computer science engineering student, is learning the basics of programming by exploring arrays. She learns about different array methods. She wishes to learn more on inserting and deleting array items. She creates monthName array to extract only the three spring months—March, April, and May—from a calendar.

-Melissa wants to extract the spring months and store them in the monthName array.Identify a method Melissa should choose to perform this task.

A) springMonths = monthName.slice(2,5);
B) springMonths = monthName.splice(2,3);
C) springMonths = monthName.slice(3,5);
D) springMonths = monthName.splice(5,3);
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/90
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 10: Exploring Arrays, loops, and Conditional Statements
1
Statement labels are used to identify statements in JavaScript code so that the statements can be referenced elsewhere in a program.
True
2
When each entry in an array matches the entry in another array,it is called a linear array.
False
3
In an array literal,the array values are a space-separated list within a set of curly brackets.
False
4
Index values start with 1 so that the initial item in an array has an index value of 1,the second item has an index value of 2,and so on.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
5
The break statement runs a command or a command block only if the conditional expression returns the value true; it does nothing if the condition is false.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
6
The do/while loop is generally used when the program loop should run at least once before testing for the stopping condition.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
7
A calendar that is created as a web table can have class and ID designations to make it easy for page developers to assign different styles to different parts of the calendar.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
8
In an if loop,a variable known as a counter variable is used to track the number of times a block of commands is run.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
9
Increasing the value of the length property adds more items to an array,but the items have null values until they are defined.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
10
JavaScript supports logical operators that connect several expressions.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
11
The appearance of any form element can be changed by modifying style sheets instead of the JavaScript code.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
12
The every(callback [,thisArg])array method applies the callback function to each item in an array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
13
The value of the length property can be reduced without removing items from an array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
14
By default,items are placed in an array either in the order in which they are defined or explicitly by index number.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
15
The getDate()method in a calendar app returns an integer ranging from 0 (Sunday)to 6 (Saturday).
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
16
When a pass statement is encountered,control is passed to the statement immediately following it.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
17
A command block is indicated by its opening and closing square brackets [ ].
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
18
The map(callback [,thisArg])method returns the index of the first element in the array that passes a test in the callback function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
19
The slice()method reverses the order of items in an array,making the last items first and the first items last.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
20
The while statement is used to exit a program loop before the stopping condition is met.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
21
What is the output of the following code?
Var x = ["a","b","c"];
X)push("d","e");
X)pop();
X)pop();

A) ​x = ["a","b","c"]
B) ​x = ["a","b","d","e"]
C) ​x = ["d","e"]
D) ​x = ["c","d","e"]
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
22
Identify the general syntax of the do/while loop.

A) do (continue){
Commands
}
While (continue){
Commands
}
B) while (continue){
Commands
}
Do (continue){
Commands
}
C) while {
Commands
}
Do (continue);
D) do {
Commands
}
While (continue);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
23
Identify the general structure of a for loop.

A) for (start;continue;update)
{
Commands
}
B) ​for (start;update)
{
Commands
}
C) ​for (start;stop)
{
Commands
}
D) ​for (start;stop;continue)
{
Commands
}
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
24
Which of the following determines the current size of an array?

A) ​array(length)
B) ​array[length]
C) ​array.length
D) ​array::length
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
25
Identify a method that is used to create a subarray.

A) ​concat()
B) ​slice()
C) ​assert()
D) ​sort()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
26
Numeric data can be sorted by creating a(n)_____ function that contrasts the values of two adjacent array items.

A) ​sum
B) ​iteration
C) ​assert
D) ​compare
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
27
Identify the syntax of the while loop.

A) while (continue){
Commands
}
B) while (start){
Commands
}
C) while [start;stop] {
Commands
}
D) while [update;continue] {
Commands
}
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
28
A _____,which employs the first-in-first-out (FIFO)principle in which the first item added to the data list is the first removed,is similar to a stack.

A) ​frame
B) ​bitmap
C) ​queue
D) ​binary tree
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
29
What is the output of the following code?
For (var i = 0; i < = 360; i+=60)

A) ​i = 0,60,120,180,240,360
B) ​i = 360,240,180,120,60,0
C) ​i = 60,120,240,480,960
D) ​i = 600,300,240,180,120,60
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
30
Identify a method that inserts new items at the front of an array.

A) ​reverse()
B) ​unshift()
C) ​assert()
D) ​sort()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
31
The _____ loop tests the condition to continue the loop right after the latest command block is run.

A) ​do/while
B) ​while
C) ​for
D) ​forEach
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
32
Identify the output of the following code.
Var x = [3,45,1234,24];
X)sort();

A) ​1234,24,3,45
B) ​3,24,45,1234
C) ​1234,45,24,3
D) ​1234,24,45
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
33
Identify a compare function that sorts numeric values in ascending order.

A) ​function ascending(a,b){
Return a - b;
}
B) ​function ascending(b,a){
Return a;
}
C) ​function ascending(a,b){
Return b - a;
}
D) ​function ascending(b,a){
Return b;
}
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
34
Identify the expression used to reference array values.

A) ​array()
B) ​array[i]
C) ​array{array1,array2,…}
D) ​array::values
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
35
Which of the following examples tests whether x is equal to 5 or y is equal to 8?

A) ​(x === 5)&& (y === 8)
B) ​(x === 5): (y === 8)
C) ​(x === 5)|| (y === 8)
D) ​(x === 5)/ (y === 8)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
36
For array data that should be treated as a queue,the _____ method is used,which is similar to the pop()method except that it removes the first array item and not the last.

A) ​reverse()
B) ​shift()
C) ​assert()
D) ​sort()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
37
Identify a compare function that sorts numeric values in descending order.

A) function descending(a,b){
Return a - b;
}
B) function descending(b,a){
Return b;
}

C) function descending(a,b){
Return b - a;
}
D) function descending(b,a){
Return a;
}
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
38
The _____ operator tests whether two items are equal in value and have the same data type.

A) ​= =
B) ​= = =
C) ​=
D) ​!=
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
39
A(n)_____ is a collection of values organized under a single name.

A) ​index
B) ​heap
C) ​array
D) ​tuple
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
40
What is the output of the following code?
For(var i = 5; i > 0; i--)

A) ​i = 4,3,2,1,0
B) ​i = 5,4,3,2,1
C) ​i = 0,1,2,3,4
D) ​i = 1,2,3,4,5
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
41
The _____ method creates a new array by passing the original array items to the callback function,which returns the equivalent value of the array items.

A) ​array.every(callback [,thisArg])
B) ​array.map(callback [,thisArg])
C) ​array.some(callback [,thisArg])
D) ​array.find(callback [,thisArg])
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
42
Identify a true statement of array.some(callback [,thisArg])method.

A) ​It tests whether the condition returned by the callback function holds for at least one item in array.
B) ​It returns the value of the first element in the array that passes a test in the callback function.
C) ​It tests whether the condition returned by the callback function holds for all items in array.
D) ​It returns the index of the first element in the array that passes a test in the callback function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
43
The _____ method diminishes array from the last element by keeping only those items that return a value of true from the callback function.

A) ​array.every(callback [,thisArg])
B) ​array.map(callback [,thisArg])
C) ​array.reduceRight(callback [,thisArg])
D) ​array.findIndex(callback [,thisArg])
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
44
Identify the expression in which the initial value of the day variable will be set to match the first day of the calendar month.

A) ​var day = Date(calDate(),calDate.getDay(),1);
B) ​var day = new Day(calDate.getDD(),calDate.getMM(),calDate.getYY(),1);
C) ​var day = new Day(calDay.getFullMonth(),calDay.getDate(),1);
D) ​var day = new Date(calDate.getFullYear(),calDate.getMonth(),1);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
45
The _____ method performs an action similar to the forEach()method except that the function it calls returns a value that can be used to match the contents of an existing array into a new array.

A) ​sort()
B) ​map()
C) ​splice()
D) ​find()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
46
Which of the following statements is used to terminate any program loop or conditional statement?

A) ​for
B) ​while
C) ​pass
D) ​break
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
47
Identify the general syntax of the forEach method.

A) array.forEach [,thisArg](){
Commands
}
B) ​array.forEach(callback [,thisArg])
C) array.forEach (value){
Commands
}
D) ​array.forEach(callback [value])
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
48
What is the output of the following code?
Var scores = [92,68,83,95,91,65,77];
Var highScores = scores.filter(gradeA);
Function gradeA(value){
Return value > 90;
}

A) ​[92,95,91]
B) ​[96,97,98]
C) ​[68,83,65,77]
D) ​[91,92,65,68,77,83]
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
49
What is the output of the following code?
Var x = [4,7,11];
X)forEach(stepUp);
Function stepUp(value,i,arr){
Arr[i] = value + 1;
}

A) ​4,7,11
B) ​3,7,11
C) ​5,8,12
D) ​8,14,22
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
50
Which of the following methods is used to determine the day of the week on which a month starts?

A) ​calDay;
B) ​day.calDay()
C) ​find.Day;
D) ​getDay()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
51
Identify a method that tests whether the condition returned by the callback function holds for all items in an array.

A) ​array.every(callback [,thisArg])
B) ​array.filter(callback [,thisArg])
C) ​array.some(callback [,thisArg])
D) ​array.find(callback [,thisArg])
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
52
What is the output of the following code?
Var sum = 0;
Var x = [1,3,7,11];
X)forEach(sumArray);
Function sumArray(value){
Sum += value;
}

A) ​0
B) ​231
C) ​11
D) ​22
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
53
Identify a true statement of array.find(callback [,thisArg])method.

A) ​It tests whether the condition returned by the callback function holds for at least one item in array.
B) ​It returns the value of the first element in the array that passes a test in the callback function.
C) ​It tests whether the condition returned by the callback function holds for all items in array.
D) ​It returns the index of the first element in the array that passes a test in the callback function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
54
Identify a method that decreases array by keeping only those items that return a value of true from the callback function.

A) ​array.every(callback [,thisArg])
B) ​array.map(callback [,thisArg])
C) ​array.reduce(callback [,thisArg])
D) ​array.find(callback [,thisArg])
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
55
Which of the following functions increases the value of each item in an array by 1?

A) ​sum()
B) ​AddArray()
C) ​StepUp()
D) ​ceil()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
56
Which of the following values will the expression 15 % 4 return?

A) ​1
B) ​11
C) ​3
D) ​60
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
57
Identify the structure of an if statement

A) if (condition){
Commands
}
B) ​if {
}(condition)
C) if {
Commands
}
D) ​if {
}
(condition){
Commands
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
58
Identify the general structure for accessing each value from an array using a for loop.

A) ​for (i < array; i++){
Commands involving array[i]
}
B) for (var i = 0; i++; i < array.length){
Commands involving array(i)
}
C) for (var i = 0; i++){
Commands involving array(i)
}
D) for (var i = 0; i < array.length; i++){
Commands involving array[i]
}
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
59
Identify a method that extracts array items that match a specified condition.

A) ​sort()
B) ​filter()
C) ​splice()
D) ​reverse()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
60
Which of the following methods creates a new array populated with the elements of array that return a value of true from the callback function?

A) ​array.every(callback [,thisArg])
B) ​array.filter(callback [,thisArg])
C) ​array.some(callback [,thisArg])
D) ​array.find(callback [,thisArg])
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
61
Melissa, a computer science engineering student, is learning the basics of programming by exploring arrays. She learns about different array methods. She wishes to learn more on inserting and deleting array items. She creates monthName array to extract only the three spring months—March, April, and May—from a calendar.

-Melissa wants to insert abbreviations of spring months into the monthName array.Which of the following methods should she use?

A) monthName.reverse(5,3,"Mar","Apr","May");
B) monthName.sort(2,3,"Mar","Apr","May");
C) monthName.join(5,3,"Mar","Apr","May");
D) monthName.splice(2,3,"Mar","Apr","May");
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
62

Identify the letter of the choice that best matches the phrase or definition.

-This method inverts the order of items in an array.

A) array.unshift(values)
B) array.toString()
C) pop()
D) concat(array1,array2,...)
E) sort()
F) copyWithin(target,start[,end])
G) join(separator)
H) shift()
I) reverse()
J)push(values)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
63
JavaScript allows for the creation of _________,in which some array values are undefined.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
64
A _________ is an operator that compares the value of one expression to another returning a Boolean value indicating whether the comparison is true or not.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
65
The collection of commands that is run each time through a loop is known collectively as a _________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
66
Gregor, a software developer, is developing a calendar application. He has to use several if conditional statements to ensure that the calendar displays the exact number of days present in each month of each year. He creates a dayCount array to keep track of the number of days in each month.

-Gregor wants to ensure February contains 29 days only in the year 2020 as it is a leap year.Which of the following should Gregor use to set the value in the dayCount array?

A) if (thisYear === 2020){
DayCount[1] = 29;
}
B) if (dayCount=29)
{
2020;
}
C) if {
ThisYear = 2020;
DayCount[1] == 29;
}
D) if {
DayCount=29 && this year=2020;
}
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
67
_________ is a number associated with each individual value in an array and distinguishes each value from other values in the array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
68
The _____ statement stops processing the commands in the current iteration of the loop and proceeds to the next iteration instead of stopping the program loop altogether.

A) ​switch
B) ​else
C) ​continue
D) ​pass
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
69
Melissa, a computer science engineering student, is learning the basics of programming by exploring arrays. She learns about different array methods. She wishes to learn more on inserting and deleting array items. She creates monthName array to extract only the three spring months—March, April, and May—from a calendar.

-Melissa wants to remove spring months from the monthName array.Which of the following methods should Melissa use?

A) springMonths = monthName.slice(2,5);
B) springMonths = monthName.splice(2,3);
C) springMonths = monthName.slice(3,5);
D) springMonths = monthName.splice(5,3);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
70
A _________ is a set of commands executed repeatedly until a stopping condition is met.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
71

Identify the letter of the choice that best matches the phrase or definition.

-This method appends an array with new items.

A) array.unshift(values)
B) array.toString()
C) pop()
D) concat(array1,array2,...)
E) sort()
F) copyWithin(target,start[,end])
G) join(separator)
H) shift()
I) reverse()
J)push(values)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
72
Gregor, a software developer, is developing a calendar application. He has to use several if conditional statements to ensure that the calendar displays the exact number of days present in each month of each year. He creates a dayCount array to keep track of the number of days in each month.

-Gregor wants to create a condition to ensure that all the years divisible by 4 should contain 29 days in February.Which of the following statements should he use?

A) if (thisYear % 4 === 0){
DayCount[1] = 29;
}
B) if (this year/4 === 0){
DayCount[2] = 29;
}
C) if (this year*4==0){
DayCount[1] = 29
}
D) if (thisYear % 4 < = 29){
DayCount[2] = 29;
}
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
73
_________ is a section of an array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
74
A _________ is a statement that runs a command or command block only when certain circumstances are met.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
75
A stack data structure employs the _________ principle in which the last items added to the stack are the first ones removed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
76

Identify the letter of the choice that best matches the phrase or definition.

-This method removes the last item from an array.

A) array.unshift(values)
B) array.toString()
C) pop()
D) concat(array1,array2,...)
E) sort()
F) copyWithin(target,start[,end])
G) join(separator)
H) shift()
I) reverse()
J)push(values)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
77
Identify the syntax of the statement label.

A) ​label = {statements}
B) ​statement!(label)
C) ​label: statements
D) ​statements.label
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
78
Arrays can be used to store information in a data structure known as a _________ in which new items are added to the top or to the end of the array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
79
The _________ returns the integer remainder after dividing one integer by another.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
80
Melissa, a computer science engineering student, is learning the basics of programming by exploring arrays. She learns about different array methods. She wishes to learn more on inserting and deleting array items. She creates monthName array to extract only the three spring months—March, April, and May—from a calendar.

-Melissa wants to extract the spring months and store them in the monthName array.Identify a method Melissa should choose to perform this task.

A) springMonths = monthName.slice(2,5);
B) springMonths = monthName.splice(2,3);
C) springMonths = monthName.slice(3,5);
D) springMonths = monthName.splice(5,3);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 90 في هذه المجموعة.