A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/javascript/javascript-promise-constructor-property/ below:

JavaScript Promise constructor Property - GeeksforGeeks

JavaScript Promise constructor Property

Last Updated : 23 Jul, 2025

JavaScript Promise constructor property is used to return the Promise constructor function for the object. The function which is returned by this property is just a reference to this function, not a Promise containing the function's name. The JavaScript number constructor, string constructor, and boolean constructor return function Number() { [native code] }, function String() { [native code] }, and function Boolean() { [native code] } respectively.

Syntax:

promise.constructor

Return Value: Promise() { [native code] }

Example 1: This example shows the basic use of Promise constructor property in JavaScript.

JavaScript
function gfg(){
    let prom = new Promise((resolve, reject) => {})
    let val = prom.constructor;
    console.log(val)
}
gfg()

Output:

ƒ Promise() { [native code] }

Example 2: This example uses the Promise constructor property of JavaScript.

JavaScript
function myGeeks() {
    let prom = new Promise((resolve, reject) => { })

    console.log(prom.constructor);
}
myGeeks()

Output
[Function: Promise]

Supported Browsers: 

We have a complete list of Javascript Promise Methods, to check those please go through the Javascript Promise Complete Reference article.



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4