<!--
{
  "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/JSObjectGetPropertyCallback",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "JavaScriptCore"
    ],
    "preciseIdentifier" : "c:@T@JSObjectGetPropertyCallback"
  },
  "title" : "JSObjectGetPropertyCallback"
}
-->

# JSObjectGetPropertyCallback

The callback type for getting a property’s value.

```
typealias JSObjectGetPropertyCallback = (JSContextRef?, JSObjectRef?, JSStringRef?, UnsafeMutablePointer<JSValueRef?>?) -> JSValueRef?
```

## Parameters

`ctx`

The execution context to use.

`object`

The [`JSObjectRef`](/documentation/JavaScriptCore/JSObjectRef) to search for the property.

`propertyName`

A [`JSStringRef`](/documentation/JavaScriptCore/JSStringRef) that contains the name of the property to get.

`exception`

A pointer to a [`JSValueRef`](/documentation/JavaScriptCore/JSValueRef) to return an exception in, if any.

## Return Value

The property’s value if the object has the property; otherwise, `NULL`.

## Discussion

If you name your function `GetProperty`, you declare it like this:

```c
JSValueRef GetProperty(JSContextRef ctx, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception);
```

If this function returns `NULL`, the get request forwards to the object’s statically declared properties, then its parent class chain (which includes the default object class), and then its prototype chain.

---

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)