Knowee
Questions
Features
Study Tools

Which of the following is a falsy value in JavaScript?Options[ ] (empty array)"false" (string)0 (number)true (boolean)

Question

Which of the following is a falsy value in JavaScript?Options[ ] (empty array)"false" (string)0 (number)true (boolean)

🧐 Not the exact question you are looking for?Go ask a question

Solution

The falsy value in JavaScript from the given options is 0 (number).

In JavaScript, a falsy value is a value that is considered false when encountered in a Boolean context. JavaScript uses type coercion in Boolean contexts.

Here are all the falsy values in JavaScript:

  • false
  • 0 and -0
  • '' and "" (empty string)
  • null
  • undefined
  • NaN

So, from your options, 0 (number) is the falsy value.

Similar Questions

Which of the following is not a primitive data type in JavaScript?Group of answer choicesBooleanStringNumberArray

Which of these values can a boolean variable contain?Options0 & 1true & falseAny integer valuetrue

Which of the following is a valid JavaScript variable data type?1.0 MarksBoolean, Undefined, Null, FunctionString, Number, Boolean, Null, UndefinedString, Number, Array, ObjectInteger, Float, Double, Character

Which function returns "TRUE" only if all its arguments are "TRUE"?Options NOT AND IF OR

What is the default value of boolean?Options: Pick one correct answer from belowtruefalse

1/3

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.