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(); |
[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.