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

Which statement correctly compares loose and strict equality for both 0 and the empty string against false?

  1. Only the empty string is loosely equal to false
  2. Both are loosely equal but not strictly equal to falseՃիշտ պատասխան
  3. Both are strictly equal but not loosely equal to false
  4. Only zero is strictly equal to false

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

Both 0 == false and the empty string == false are true after loose-equality coercion. Their strict comparisons are false because neither the number nor the string has the boolean type of false.

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

Սկսել վարժանքը
Հարց 19: Which statement correctly compares loose and strict… · JavaScript Fundamentals · Questena