0 of 8 problems solved • 0%
Use in a course

Exercise prompt

Check for a Property

The in operator checks whether an object has a named property and produces a boolean.

Example

const user = { name: "Ava" }; console.log("name" in user); // true

Your task

Predict whether contact has a phone property. Replace the empty prediction, then add an Actual: line using the in operator.

Hint

in checks whether a key exists without reading its value.