Friday, September 19, 2025
HomeLanguagesJavascriptJavaScript Promise constructor Property

JavaScript Promise constructor Property

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: 

  • Google Chrome 
  • Edge 12 
  • Mozilla Firefox 
  • Opera
  • Safari

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

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
RELATED ARTICLES

Most Popular

Dominic
32301 POSTS0 COMMENTS
Milvus
84 POSTS0 COMMENTS
Nango Kala
6666 POSTS0 COMMENTS
Nicole Veronica
11840 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11898 POSTS0 COMMENTS
Shaida Kate Naidoo
6781 POSTS0 COMMENTS
Ted Musemwa
7056 POSTS0 COMMENTS
Thapelo Manthata
6739 POSTS0 COMMENTS
Umr Jansen
6744 POSTS0 COMMENTS