QuestenaPractice that shows what to review next
Question 106

Which statements about iterating array.entries() with for...of are true? Select all that apply.

  1. array.entries() immediately returns one array containing every pair
  2. Each yielded item is a two-element index-and-value pairCorrect answer
  3. The iterator yields element values without their indexes
  4. Pair destructuring can bind an index and its value during iterationCorrect answer

Explanation

The entries iterator yields one two-element array at a time, containing an index and its associated value. Destructuring can bind those two parts during for...of; the method does not itself materialize one large array of every pair.

Continue with this test

Start practice
Question 106: Which statements about iterating array.entries() with… · JavaScript Fundamentals · Questena