Truthy and Falsy

Talk it through with a coach who asks guiding questions and gives hints until you reach the answer. Pass to mark the challenge as completed.

The problem

  • easy
  • Pro

A function sets a default page size by writing the argument or twenty, but when a caller passes zero the page size becomes twenty anyway. Explain which values JavaScript treats as falsy, why this bug happens, and how you'd fix it.

Talk this problem through with an AI coach

This is a Pro challenge. Sign in with Google, then upgrade to start a voice session.

Start free →