Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Object.getPrototypeOf()

Esta traducción está incompleta. Por favor, ayuda a traducir este artículo del inglés.

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.

Ejemplos

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.

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

Especificaciones

Especificación Estado Comentario
ECMAScript 5.1 (ECMA-262)
The definition of 'Object.getPrototypeOf' in that specification.
Standard Definición inicial.
ECMAScript 6 (ECMA-262)
The definition of 'Object.getProtoypeOf' in that specification.
Release Candidate  

Compatibilidad con navegadores

Característica Chrome Firefox (Gecko) Internet Explorer Opera Safari
Soporte básico 5 3.5 (1.9.1) 9 12.10 (tal vez en las últimas versiones) 5
Característica Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Soporte básico ? ? ? ? ? ?

Based on Kangax's compat table.

Notas espécificas sobre Opera

A pesar de que las versiones anteriores de opera no soportan aun Object.getPrototypeOf(), Opera soporta la propiedad no estándar __proto__ desde Opera 10.50.

Mira también

Etiquetas y colaboradores del documento

 Colaboradores en esta página: Siro_Diaz
 Última actualización por: Siro_Diaz,