Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

214
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda