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


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

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

://developer.mozilla.org/favicon.ico" />

Esta página ha sido traducida del inglés por la comunidad. Aprende más y únete a la comunidad de MDN Web Docs.

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 julio de 2015.

Resumen

El método Object.getPrototypeOf() devuelve el prototipo (es decir, el valor de la propiedad interna [[Prototype]]) del objeto especificado.

Sintaxis

Object.getPrototypeOf(obj)

Parámetros

obj

El objeto cuyo prototipo va a ser devuelto.

Valor Devuelto

El prototipo del objeto dado. Si no existen propiedades heredadas se devolverá null.

Ejemplos

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

Notas

En ES5, lanzará una excepción TypeError si el parámetro obj no es un objeto. en ES6, El parámetro será forzado a un Object.

js
> Object.getPrototypeOf('foo')
TypeError: "foo" is not an object  // ES5 code
> Object.getPrototypeOf('foo')
String.prototype                   // ES6 code

Especificaciones

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

Compatibilidad con navegadores

Mira también

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