Exam 10: Exploring Arrays Loops and Conditional Statements Tutorial

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

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.

(Multiple Choice)
5.0/5
(36)
Identify the letter of the choice that best matches the phrase or definition.
This method links all items in the array into a single text string.
sort()
This method appends an array with new items.
push(values
This method joins the array to two or more arrays, creating a single array containing the items from all the arrays.
pop()
Correct Answer:
Verified
Premises:
Responses:
This method links all items in the array into a single text string.
sort()
This method appends an array with new items.
push(values
This method joins the array to two or more arrays, creating a single array containing the items from all the arrays.
pop()
This method inserts new items at the start of an array.
join(separator)
This method removes the first item from an array.
reverse()
This method rearranges array items in alphabetical order.
copyWithin(target, start[, end])
This method duplicates items within an array.
concat(array1, array2,...)
This method removes the last item from an array.
shift()
This method inverts the order of items in an array.
array.toString()
This method converts the contents of an array to a text sequence with the array values in a comma-separated list.
array.unshift(values)
(Matching)
4.9/5
(34)

The appearance of any form element can be changed by modifying style sheets instead of the JavaScript code.

(True/False)
4.8/5
(34)

Which of the following examples tests whether x is equal to 5 or y is equal to 8?

(Multiple Choice)
4.8/5
(40)

Which of the following functions increases the value of each item in an array by 1?

(Multiple Choice)
4.7/5
(44)

The _____ operator tests whether two items are equal in value and have the same data type.

(Multiple Choice)
4.8/5
(34)

When each entry in an array matches the entry in another array, it is called a linear array.

(True/False)
4.8/5
(40)

Identify the expression in which the initial value of the day variable will be set to match the first day of the calendar month.

(Multiple Choice)
4.9/5
(33)

Identify the general syntax of the do/while loop.

(Multiple Choice)
4.9/5
(36)

T he value of the length property can be reduced without removing items from an array.

(True/False)
4.9/5
(37)

Identify the general syntax of the forEach method.

(Multiple Choice)
4.8/5
(38)

Case-Based Critical Thinking Questions Case 9-2 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?

(Multiple Choice)
4.8/5
(40)

When a pass statement is encountered, control is passed to the statement immediately following it.

(True/False)
4.7/5
(35)

Statement labels are used to identify statements in JavaScript code so that the statements can be referenced elsewhere in a program.

(True/False)
4.9/5
(39)

What is the output of the following code? var x = ["a", "b", "c"]; x.push("d", "e"); x.pop(); x.pop();

(Multiple Choice)
4.8/5
(33)

Case-Based Critical Thinking Questions Case 9-1 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?

(Multiple Choice)
4.9/5
(32)

Case-Based Critical Thinking Questions Case 9-2 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?

(Multiple Choice)
4.8/5
(37)

Identify a method that decreases array by keeping only those items that return a value of true from the callback function.

(Multiple Choice)
4.8/5
(37)

Identify the output of the following code. var x = [3, 45, 1234, 24]; x.sort();

(Multiple Choice)
4.9/5
(40)

Case-Based Critical Thinking Questions Case 9-1 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.

(Multiple Choice)
4.9/5
(37)
Showing 21 - 40 of 73
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)