<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "JavaScriptCore",
  "identifier" : "/documentation/JavaScriptCore/JSValue/init(newPromiseResolvedWithResult:in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "JavaScriptCore"
    ],
    "preciseIdentifier" : "c:objc(cs)JSValue(cm)valueWithNewPromiseResolvedWithResult:inContext:"
  },
  "title" : "init(newPromiseResolvedWithResult:in:)"
}
-->

# init(newPromiseResolvedWithResult:in:)

Creates a resolved promise object with the specified value.

```
init!(newPromiseResolvedWithResult result: Any!, in context: JSContext!)
```

## Parameters

`result`

The result value to pass to any reactions.

`context`

The [`JSContext`](/documentation/JavaScriptCore/JSContext) the resulting [`JSValue`](/documentation/JavaScriptCore/JSValue) belongs to.

## Return Value

A [`JSValue`](/documentation/JavaScriptCore/JSValue) that represents a new promise JavaScript object.

## Discussion

This method is equivalent to calling the following:

```objc
[JSValue valueWithNewPromiseFromExecutor:^(JSValue *resolve, JSValue *reject) { 
    [resolve callWithArguments:@[result]]; 
} inContext:context];
```

---

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)