QuestenaՎարժանք, որը ցույց է տալիս՝ ինչ կրկնել հաջորդիվ
Հարց 57

Which statements about reduce are true? Select all that apply.

  1. It always returns an array
  2. It always requires an explicit initial value
  3. It combines elements into one accumulated resultՃիշտ պատասխան
  4. A supplied initial value starts the accumulatorՃիշտ պատասխան

Բացատրություն

reduce combines elements through an accumulator, and a supplied initial value starts that accumulation. Without one on a nonempty array, the first element becomes the starting accumulator rather than being combined as an ordinary later element immediately.

Շարունակեք այս թեստով

Սկսել վարժանքը
Հարց 57: Which statements about reduce are true? Select all that… · JavaScript Fundamentals · Questena