(Ad, please don’t block.)

Quizzes » Booleans

1. typeof

Which assertion holds?

2. Falsy values

Which of these values are falsy?

3. Checking if a parameter was provided

function func(arg) {
  if (!arg) {
    throw new Error('Missing argument');
  }
  return 'ok';
}

Which of these function calls throw errors?

4. Checking if a property exists

function func(obj) {
  if (!obj.prop) {
    throw new Error('Missing property `prop`');
  }
  return 'ok';
}

Which of these function calls throw errors?

5. Logical And (1/3)

6. Logical And (2/3)

7. Logical And (3/3)

8. Logical Or (1/3)

9. Logical Or (2/3)

10. Logical Not

Which of the following expressions are true (the others are false)?


Correct answers: 0 out of 0