Sunday, November 17, 2024
Google search engine
HomeLanguagesJavascriptJavaScript ArrayBuffer constructor Property

JavaScript ArrayBuffer constructor Property

JavaScript ArrayBuffer constructor property is used to return the ArrayBuffer constructor function for the object. The function returned by this property is just the reference, not the actual ArrayBuffer. It is an object property of JavaScript and can be used with Strings, Numbers, etc.

Syntax:

arraybuffer.constructor

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

The below examples will illustrate the ArrayBuffer Constructor Property:

Example 1: In this example, we will see the basic use of ArrayBuffer Constructor Property in JavaScript.

Javascript




function fun(){
    let x = new ArrayBuffer();
    console.log(x.constructor)
}
fun();


Output:

ƒ ArrayBuffer() { [native code] }

Example 2: In this example, we will use this property to print on the browser window

Javascript




function myGeeks() {
    let looseSet = new ArrayBuffer();
 
    console.log(looseSet.constructor);
}
myGeeks();


Output

[Function: ArrayBuffer]

Supported Browsers:

  • Chrome
  • Edge
  • Firefox
  • Opera
  • Safari

We have a complete list of ArrayBuffer methods and properties, to check Please go through the ArrayBuffer 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

Recent Comments