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

A condition receives the string "false". How does that string behave?

  1. It is falsy because its text names false
  2. It throws when converted to boolean
  3. It is truthy only after numeric conversion
  4. It is truthy because it is nonemptyՃիշտ պատասխան

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

The string contains characters, so it is truthy regardless of what its text appears to mean. Confusing it with the boolean false ignores that nonempty-string truthiness depends on length, not interpretation.

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

Սկսել վարժանքը
Հարց 22: A condition receives the string "false". How does that… · JavaScript Fundamentals · Questena