JavaScript-array-constructor
Voorbeeld
Haal de array-constructor op:
const fruits = ["Banana", "Orange", "Apple", "Mango"];
let text = fruits.constructor;
Definitie en gebruik
De constructor
eigenschap retourneert de functie die het Array-prototype heeft gemaakt.
Voor JavaScript-arrays constructor
retourneert de eigenschap:
functie Array() { [native code] }
Syntaxis
array.constructor
Winstwaarde
functie Array() { [native code] } |
Browserondersteuning
constructor
is een ECMAScript1 (ES1)-functie.
ES1 (JavaScript 1997) wordt volledig ondersteund in alle browsers:
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | Yes | Yes | Yes | Yes | Yes |