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

Which pair of results is produced by Object.is(NaN, NaN) and Object.is(0, -0), respectively?

  1. false for NaN, false for signed zero
  2. true for NaN, false for signed zeroՃիշտ պատասխան
  3. false for NaN, true for signed zero
  4. true for NaN, true for signed zero

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

Object.is regards NaN as the same as itself and distinguishes positive zero from negative zero. Strict equality behaves differently in both special cases, so using its outcomes here would reverse the pair.

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

Սկսել վարժանքը
Հարց 12: Which pair of results is produced by Object.is(NaN, NaN)… · JavaScript Fundamentals · Questena