Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

213
Vistas
How to display javascript prototype, conscructor, scope inside html element
  • I'm trying to create a simulator for console.log to use it in my phone to show deferant datatype result, code errors - the code is working fine and display, highlight all datatypes

enter image description here

  • but i want also to display constcrutor, scopes, prototypes like the web console is there's a way to loop throw them and get their data like this image

enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The constructor property can be gotten by referencing it explicitly, or by iterating over all properties of the object (not just enumerable properties), with Object.getOwnPropertyNames.

The [[Prototype]] property is equivalent to the value returned by Object.getPrototypeOf, so you can call that to access the prototype object and iterate through it too, if you want.

Perhaps something like:

const recursiveLogAllProperties = (obj) => {
  Object.getOwnPropertyNames(obj).forEach(prop => console.log(prop, obj[prop]));
  const proto = Object.getPrototypeOf(obj);
  if (proto === Object.prototype) return;
  console.log('------ Prototype:');
  recursiveLogAllProperties(proto);
}
const arr = [1, 2];
recursiveLogAllProperties(arr);

The [[Scopes]] internal property is not accessible from JavaScript.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda