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

The function label is written as (value = "new") => value. Which pair of call results is correct?

  1. label(undefined) gives undefined; label(null) gives new
  2. label(undefined) gives new; label(null) gives new
  3. label(undefined) gives new; label(null) gives nullՃիշտ պատասխան
  4. Both calls throw because defaults require no argument syntax

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

A default initializer is selected for a missing argument or one explicitly equal to undefined, so label(undefined) gives new. Passing null supplies an actual argument, so label(null) preserves null rather than treating it as absent.

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

Սկսել վարժանքը
Հարց 79: The function label is written as (value = "new") => value.… · JavaScript Fundamentals · Questena