console.log to use it in my phone to show deferant datatype result, code errors - the code is working fine and display, highlight all datatypesconstcrutor, scopes, prototypes like the web console is there's a way to loop throw them and get their data like this imageThe 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.