AI

The ternary operator ? : is a condensed if/else. Also learn typeof and the in operator.

Your Task:

  • Use ternary to set status = "adult" if age >= 18, else "minor"
  • Use typeof to check if value is a "string" → isString
  • Use in operator to check if "name" exists in user object → hasName
TypeScript Solution
Loading...

Submit your code to see test results