JavaScript Reflect.has() MethodThe static Reflect.has() method is used to check if a property exists in an object. It works like the in operator as a function. Syntax:Parameters:target: It is the object in which to look for the property. propertyKey: It is the name of the property to check. Return value:It returns a Boolean which indicates whether or not the target has the property. Exceptions:A TypeError, if the target is not an Object. Browser Support:
Example 1Output: true Example 2Output: false Example 3Output: true true false false
Next TopicJavaScript Reflect
|