February 2018
Intermediate to advanced
298 pages
8h 22m
English
The Reflect.has() is used to check if a property exists in an object. It also checks for the inherited properties. It returns true if the property exists. Otherwise, it returns false.
It's the same as the in operator in JavaScript.
Here is a code example that demonstrates how to use the Reflect.has() method:
var obj = { __proto__: { name: "Eden" }, age: 12 }; console.log(Reflect.has(obj, "name")); //Output "true" console.log(Reflect.has(obj, "age")); //Output "true"
Read now
Unlock full access