where is stored the property "cle" of an object created with for example "const o = Object.create({cle:"valeur"})"?

Viewed 2

When we create an object "o" with the following syntax [ const o = Object.create({cle:"valeur"}) ] , where is stored and hidden the property "cle" ? It is accessible with only [ o.cle ]

and with none of the following commands :

How can we list the property "cle" or else ?

  const o = Object.create({cle:"valeur"});
  console.log(o.cle);  // valeur

  console.log(Object.entries(o));
  // []  length:0  [[Prototype]]:Array(0)

  console.log(Object.getOwnPropertyDescriptors(o));
  // {}  [[Prototype]]:Object

  console.log(Object.getOwnPropertyDescriptor(o,"cle"));
  // undefined

  console.log(Object.getOwnPropertyNames(o));
  // []  length:0  [[Prototype]]:Array(0)

  console.log(Object.hasOwnProperty(o,"cle"));
  // false

  console.log(Object.hasOwn(o,"cle"));
  // false

  console.log(o.prototype);  // undefined

  console.log(Object.prototype);
  // no "cle"
0 Answers
Related