Age of majority

isAdult(age) returns true from age 18. Your tests must pass on the correct code and catch the 3 bugs.

Concept: lesson Both sides of a rule

Exercise

/**
 * Returns true when the person is an adult (18 or older), false otherwise.
 * @param {number} age  Whole years.
 * @returns {boolean}
 */
function isAdult(age)

Your tests

0 of 3 bugs caught

  • Bug 1: hidden
  • Bug 2: hidden
  • Bug 3: hidden