I am writing some ES/JS tooling. In DevTools I can see lots of classes, e.g. ArrayBuffer. Yet when I try to extract such names from window
global context, I can't see them. This snippet gives similar results in Chrome, FireFox and Opera.
console.log('typeof window.ArrayBuffer:',
typeof window.ArrayBuffer);
console.log("window.hasOwnProperty('ArrayBuffer'):",
window.hasOwnProperty('ArrayBuffer'));
let c = 0;
for (let n in window) {
// console.log(n);
if (n == 'ArrayBuffer') {
console.log('FOUND: ArrayBuffer');
}
c++;
}
console.log(c + ' attributes checked')
If I uncomment the // console.log(n);
line, I can see the names of the attributes, but none of the classes.
How do I access those class (API) names?