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

Given [1, 2, 3].map(x => x * 2), what is returned?

  1. [2, 4, 6]Ճիշտ պատասխան
  2. [1, 2, 3] after in-place doubling
  3. true
  4. undefined

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

map calls the callback for each present element and collects the callback results into a new array, producing doubled values. It does not silently replace the original array unless the program assigns the returned array back.

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

Սկսել վարժանքը
Հարց 49: Given [1, 2, 3].map(x => x * 2), what is returned? · JavaScript Fundamentals · Questena