Skip to main content
Version: 3.28.0

Reflect.has()

The static Reflect.has() method works like the in operator as a function.

Syntax

Reflect.has(target, propertyKey)

Parameters

  • target
    • : The target object in which to look for the property.
  • propertyKey
    • : The name of the property to check.

Return value

A Boolean indicating whether or not the target has the property.

Exceptions

A TypeError, if target is not an Object.

Description

The Reflect.has method allows you to check if a property is in an object. It works like the in operator as a function.