Exam 10: Exploring Arrays Loops and Conditional Statements Tutorial

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

Explain the length property of an array with examples.

(Essay)
4.8/5
(46)

A command block is indicated by its opening and closing square brackets [ ].

(True/False)
4.8/5
(42)

The _____ method diminishes array from the last element by keeping only those items that return a value of true from the callback function.

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

Identify a true statement of array .find( callback [, thisArg ]) method.

(Multiple Choice)
4.8/5
(43)

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; }

(Multiple Choice)
4.9/5
(51)

Identify a method that inserts new items at the front of an array.

(Multiple Choice)
4.9/5
(43)

Identify the syntax of the while loop.

(Multiple Choice)
4.9/5
(29)

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.

(Multiple Choice)
4.9/5
(40)

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; }

(Multiple Choice)
4.8/5
(33)

Briefly explain the process of using arrays as data stacks.

(Essay)
4.8/5
(29)

Numeric data can be sorted by creating a(n) _____ function that contrasts the values of two adjacent array items.

(Multiple Choice)
4.8/5
(34)

The _____ loop tests the condition to continue the loop right after the latest command block is run.

(Multiple Choice)
4.8/5
(35)
Showing 61 - 73 of 73
close modal

Filters

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