0 of 8 problems solved • 0%

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); // outputs true

Predict the output

A contact card checks whether a phone field is available. Predict the result of the property check.

const contact = { email: "[email protected]" }; console.log("Has phone:", "phone" in contact);
What will this code print?