<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "JavaScriptCore",
  "identifier" : "/documentation/JavaScriptCore/JSObjectHasProperty(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "JavaScriptCore"
    ],
    "preciseIdentifier" : "c:@F@JSObjectHasProperty"
  },
  "title" : "JSObjectHasProperty(_:_:_:)"
}
-->

# JSObjectHasProperty(_:_:_:)

Tests whether an object has a specified property.

```
func JSObjectHasProperty(_ ctx: JSContextRef!, _ object: JSObjectRef!, _ propertyName: JSStringRef!) -> Bool
```

## Parameters

`object`

The [`JSObjectRef`](/documentation/JavaScriptCore/JSObjectRef) to test.

`propertyName`

A [`JSStringRef`](/documentation/JavaScriptCore/JSStringRef) that contains the property’s name.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the object has a property with a name that matches `propertyName`; otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)