A
Q. Which of the operator is used to test if a particular property exists or not?
- Correct Answer - Option(C)
- Views: 29
- Filed under category JavaScript
- Hashtags:
A
The in operator is used to test if a property exists in an object or in an array. For example:
let obj = { name: "John", age: 30 };
console.log("name" in obj); // true
console.log("address" in obj); // false
This checks if the property (e.g., "name") is present in the object (obj).
You must be Logged in to update hint/solution
Be the first to start discuss.
Discusssion
Login to discuss.