JS: Global Functions Without Property Key "prototype"
Here is code to print all global function objects and report if they have key
"prototype"
.
// print all global function objects and report if they have string key prototype const x_yes = []; const x_no = []; (Reflect.ownKeys(globalThis)).forEach( (x) => { if (typeof globalThis[x] === "function") { if (globalThis[x].hasOwnProperty("prototype")) { x_yes.push(x); } else x_no.push(x); } }, ); console.log("Has key prototype", x_yes); /* "Object", "Function", "Array", "Number", "Boolean", "String", "Symbol", "Date", "Promise", "RegExp", "Error", "AggregateError", "EvalError", "RangeError", "ReferenceError", "SyntaxError", "TypeError", "URIError", "ArrayBuffer", "Uint8Array", "Int8Array", "Uint16Array", "Int16Array", "Uint32Array", "Int32Array", "Float32Array", "Float64Array", "Uint8ClampedArray", "BigUint64Array", "BigInt64Array", "DataView", "Map", "BigInt", "Set", "WeakMap", "WeakSet", "FinalizationRegistry", "WeakRef", "queueMicrotask", "AbortController", "AbortSignal", "Blob", "ByteLengthQueuingStrategy", "CloseEvent", "CompressionStream", "CountQueuingStrategy", "CryptoKey", "CustomEvent", "DecompressionStream", "DOMException", "ErrorEvent", "Event", "EventTarget", "File", "FileReader", "FormData", "Headers", "MessageEvent", "Performance", "PerformanceEntry", "PerformanceMark", "PerformanceMeasure", "PromiseRejectionEvent", "ProgressEvent", "ReadableStream", "ReadableStreamDefaultReader", "Request", "Response", "TextDecoder", "TextEncoder", "TextDecoderStream", "TextEncoderStream", "TransformStream", "URL", "URLPattern", "URLSearchParams", "WebSocket", "MessageChannel", "MessagePort", "Worker", "WritableStream", "WritableStreamDefaultWriter", "WritableStreamDefaultController", "ReadableByteStreamController", "ReadableStreamBYOBReader", "ReadableStreamBYOBRequest", "ReadableStreamDefaultController", "TransformStreamDefaultController", "atob", "btoa", "CacheStorage", "Cache", "Crypto", "SubtleCrypto", "fetch", "reportError", "structuredClone", "Iterator", "SharedArrayBuffer", "Location", ... 11 more items */ console.log("No key prototype", x_no);