pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Object/getPrototypeOf

loper.mozilla.org/favicon.ico" />

Dieser Inhalt wurde automatisch aus dem Englischen übersetzt, und kann Fehler enthalten. Erfahre mehr über dieses Experiment.

View in English Always switch to English

Object.getPrototypeOf()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since Juli 2015.

Die statische Methode Object.getPrototypeOf() gibt das Prototypobjekt (d.h. den Wert der internen [[Prototype]]-Eigenschaft) des angegebenen Objekts zurück.

Probieren Sie es aus

const prototype = {};
const object = Object.create(prototype);

console.log(Object.getPrototypeOf(object) === prototype);
// Expected output: true

Syntax

js
Object.getPrototypeOf(obj)

Parameter

obj

Das Objekt, dessen Prototyp zurückgegeben werden soll.

Rückgabewert

Der Prototyp des angegebenen Objekts, der möglicherweise null ist.

Beispiele

Verwendung von getPrototypeOf

js
const proto = {};
const obj = Object.create(proto);
Object.getPrototypeOf(obj) === proto; // true

Zwangsumwandlung von Nicht-Objekten

In ES5 wird eine TypeError-Ausnahme geworfen, wenn der obj-Parameter kein Objekt ist. In ES2015 wird der Parameter in ein Object umgewandelt.

js
Object.getPrototypeOf("foo");
// TypeError: "foo" is not an object (ES5 code)
Object.getPrototypeOf("foo");
// String.prototype                  (ES2015 code)

Spezifikationen

Specification
ECMAScript® 2026 Language Specification
# sec-object.getprototypeof

Browser-Kompatibilität

Siehe auch

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

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