Open In App

JavaScript String constructor Property

Last Updated : 11 Jul, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

The String constructor property in JavaScript is used to return the string constructor function for the object. The function which is returned by this property is just the reference to this function, not a string 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: 

string.constructor

Return Value:

  • function String() { [native code] }

Example 1: This example shows the basic use of the String constructor Property in Javascript.

JavaScript
function func() {
    let str = 'Geeks for Geeks';
    let value = str.constructor;
    console.log(value);
}
func(); 

Output:  

function String() { [native code] }

Example 2: This example uses the String constructor Property of Javascript.

JavaScript
function myGeeks() {
    let str = "Hello World!";

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

Output
[Function: String]

Supported Browsers:

The browser supported by the String constructor property are listed below.

  • Google Chrome 1
  • Edge 12
  • Apple Safari 1
  • Firefox 1
  • Opera 3

Similar Reads

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy