JavaScript, the language, tracks the ECMAScript Scripting Language Specification, so all of the standard objects in the ECMAScript specification are available to your JavaScript programs. Here are those objects, with a representative set of their properties:
Name | Prototype | Properties |
---|---|---|
The global object (unnamed) | Implemen- tation dependent | globalThis Infinity NaN undefined eval() isFinite() isNaN() parseFloat() parseInt() decodeURI() decodeURIComponent() encodeURI() encodeURIComponent() Math JSON Reflect Atomics Object() Function() Boolean() Number() BigInt() String() Symbol() Array() Float32Array() Float64Array() Int8Array() Int16Array() Int32Array() Uint8Array() Uint8ClampedArray() Uint16Array() Uint32Array() BigInt64Array() BigUint64Array() ArrayBuffer() SharedArrayBuffer() DataView() Date() RegExp() Set() WeakSet() Map() WeakMap() Proxy() Promise() Error() SyntaxError() RangeError() TypeError() ReferenceError() URIError() EvalError() |
Object | Function. prototype | prototype create() assign() is() getPrototypeOf() setPrototypeOf() defineProperties() defineProperty() getOwnPropertyDescriptor() getOwnPropertyDescriptors() getOwnPropertyNames() getOwnPropertySymbols() keys() values() entries() preventExtensions() isExtensible() seal() isSealed() freeze() isFrozen() |
Object.prototype | null | constructor toString() toLocaleString() valueOf() hasOwnProperty() isPrototypeOf() propertyIsEnumerable() |
Math | Object. prototype | E LN10 LN2 LOG2E LOG10E PI SQRT1_2 SQRT2 abs() acos() acosh() asin() asinh() atan() atanh() atan2() cbrt() ceil() clz32() cos() cosh() exp() expm1() floor() fround() hypot() imul() log() log1p() log10() log2() max() min() pow() random() round() sign() sin() sinh() sqrt() tan() tanh() trunc() |
JSON | Object. prototype | parse() stringify() |
Reflect | Object. prototype | getPrototypeOf() setPrototypeOf() construct() ownKeys() has() defineProperty() getOwnPropertyDescriptor() get() set() apply() deleteProperty() isExtensible() preventExtensions() |
Atomics | Object. prototype | add() and() compareExchange() exchange() isLockFree() load() or() store() sub() wait() wake() xor() |
Function | Function. prototype | length prototype |
Function.prototype | Object. prototype | constructor toString() apply() call() bind() |
Function instances | Function. prototype | name length prototype |
Boolean | Function. prototype | prototype |
Boolean.prototype | Object. prototype | constructor toString() valueOf() |
Number | Function. prototype | prototype NEGATIVE_INFINITY POSITIVE_INFINITY MIN_VALUE MAX_VALUE isFinite() EPSILON isInteger() MIN_SAFE_INTEGER MAX_SAFE_INTEGER isSafeInteger() NaN isNaN() parseInt() parseFloat() |
Number.prototype | Object. prototype | constructor toString() toLocaleString() valueOf() toFixed() toExponential() toPrecision() |
BigInt | Function. prototype | prototype asIntN() asUintN() |
BigInt.prototype | Object. prototype | constructor toString() toLocaleString() valueOf() |
String | Function. prototype | prototype fromCharCode() fromCodePoint() raw() |
String.prototype | Object. prototype | constructor charAt() charCodeAt() codePointAt() startsWith() endsWith() includes() indexOf() lastIndexOf() slice() substring() toLowerCase() toUpperCase() toLocaleLowerCase() toLocaleUpperCase() normalize() localeCompare() trim() trimStart() trimEnd() padStart() padEnd() concat() repeat() match() matchAll() search() replace() split() toString() valueOf() |
String instances | String. prototype | length |
Symbol | Function. prototype | prototype hasInstance isConcatSpreadable iterator asyncIterator match replace search species split() toPrimitive toStringTag unscopables for() keyFor() |
Symbol.prototype | Object. prototype | constructor toString() valueOf() |
RegExp | Function. prototype | prototype |
RegExp.prototype | Object. prototype | constructor flags global ignoreCase unicode multiline sticky dotAll source test() exec() toString() |
RegExp instances | RegExp. prototype | lastIndex |
Date | Function. prototype | prototype parse() UTC() now() |
Date.prototype | Object. prototype | constructor getDate() getTime() getFullYear() getMonth() getDay() getHours() getMinutes() getSeconds() getMilliseconds() getTimezoneOffset() getUTCDate() getUTCFullYear() getUTCMonth() getUTCDay() getUTCHours() getUTCMinutes() getUTCSeconds() getUTCMilliseconds() setDate() setTime() setFullYear() setMonth() setHours() setMinutes() setSeconds() setMilliseconds() setUTCDate() setUTCFullYear() setUTCMonth() setUTCHours() setUTCMinutes() setUTCSeconds() setUTCMilliseconds() toString() toISOString() toUTCString() toDateString() toTimeString() toLocaleString() toLocaleDateString() toLocaleTimeString() toJSON() valueOf() |
Array | Function. prototype | prototype isArray() of() from() |
Array.prototype | Object. prototype | constructor keys() values() entries() includes() find() findIndex() indexOf() lastIndexOf() slice() every() some() forEach() map() filter() reduce() reduceRight() pop() push() shift() unshift() copyWithin() join() concat() fill() sort() reverse() splice() toLocaleString() toString() |
Array instances | Array. prototype | length |
Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array | Function. prototype | prototype BYTES_PER_ELEMENT of() from() |
Int8Array.prototype Uint8Array.prototype Uint8ClampedArray.prototype Int16Array.prototype Uint16Array.prototype Int32Array.prototype Uint32Array.prototype Float32Array.prototype Float64Array.prototype | Object. prototype | constructor BYTES_PER_ELEMENT buffer byteLength byteOffset length keys() values() entries() includes() find() findIndex() indexOf() lastIndexOf() slice() every() some() forEach() map() filter() reduce() reduceRight() copyWithin() join() fill() sort() reverse() set() subarray() toLocaleString() toString() |
Set | Function. prototype | prototype |
Set.prototype | Object. prototype | constructor size has() keys() values() entries() add() clear() delete() forEach() |
ArrayBuffer | Function. prototype | prototype isView |
ArrayBuffer.prototype | Object. prototype | constructor byteLength slice() |
SharedArrayBuffer | Function. prototype | prototype |
SharedArrayBuffer.prototype | Object. prototype | constructor byteLength slice() |
DataView | Function. prototype | prototype |
DataView.prototype | Object. prototype | constructor buffer byteLength byteOffset getInt8() setInt8() getInt16() setInt16() getInt32() setInt32() getUint8() setUint8() getUint16() setUint16() getUint32() setUint32() setFloat64() setFloat32() getFloat64() getFloat32() |
WeakSet | Function. prototype | prototype |
WeakSet.prototype | Object. prototype | constructor has() add() has() delete() |
Map | Function. prototype | prototype |
Map.prototype | Object. prototype | constructor size has() get() set() keys() values() entries() clear() delete() forEach() |
WeakMap | Function. prototype | prototype |
WeakMap.prototype | Object. prototype | constructor has() get() set() delete() |
Proxy | Function. prototype | revocable() |
Proxy.prototype | Object. prototype | |
Promise | Function. prototype | prototype all() race() resolve() reject() |
Promise.prototype | Object. prototype | constructor then() catch() |
Error | Function. prototype | prototype |
Error.prototype | Object. prototype | constructor name message toString() |
EvalError RangeError ReferenceError SyntaxError TypeError URIError | Function. prototype | prototype |
EvalError.prototype RangeError.prototype ReferenceError.prototype SyntaxError.prototype TypeError.prototype URIError.prototype | Error. prototype | constructor name message |
ECMAScript only specifies core stuff for computation. No graphics, no input-output, no networking. This stuff is left to the environment in which your JavaScript code is hosted. If you have a browser, you will likely have hundreds of additional objects available.
For fun, I listed all of the own property names of the global object in the JavaScript interpreter in the Chrome 54 version on a macOS laptop. After taking out the ECMAScript-specific properties, this is what I saw:
AnalyserNode AnimationEvent AppBannerPromptResult ApplicationCache ApplicationCacheErrorEvent Attr Audio AudioBuffer AudioBufferSourceNode AudioContext AudioDestinationNode AudioListener AudioNode AudioParam AudioProcessingEvent BarProp BatteryManager BeforeInstallPromptEvent BeforeUnloadEvent BiquadFilterNode Blob BlobEvent BroadcastChannel ByteLengthQueuingStrategy CDATASection CSS CSSFontFaceRule CSSGroupingRule CSSImportRule CSSKeyframeRule CSSKeyframesRule CSSMediaRule CSSNamespaceRule CSSPageRule CSSRule CSSRuleList CSSStyleDeclaration CSSStyleRule CSSStyleSheet CSSSupportsRule CSSViewportRule Cache CacheStorage CanvasCaptureMediaStreamTrack CanvasGradient CanvasPattern CanvasRenderingContext2D ChannelMergerNode ChannelSplitterNode CharacterData ClientRect ClientRectList ClipboardEvent CloseEvent Comment CompositionEvent ConvolverNode CountQueuingStrategy Credential CredentialsContainer Crypto CryptoKey CustomElementRegistry CustomEvent DOMError DOMException DOMImplementation DOMParser DOMStringList DOMStringMap DOMTokenList DataTransfer DataTransferItem DataTransferItemList DelayNode DeviceMotionEvent DeviceOrientationEvent Document DocumentFragment DocumentType DragEvent DynamicsCompressorNode Element ErrorEvent Event EventSource EventTarget FederatedCredential File FileList FileReader FocusEvent FontFace FormData GainNode Gamepad GamepadButton GamepadEvent HTMLAllCollection HTMLAnchorElement HTMLAreaElement HTMLAudioElement HTMLBRElement HTMLBaseElement HTMLBodyElement HTMLButtonElement HTMLCanvasElement HTMLCollection HTMLContentElement HTMLDListElement HTMLDataListElement HTMLDetailsElement HTMLDialogElement HTMLDirectoryElement HTMLDivElement HTMLDocument HTMLElement HTMLEmbedElement HTMLFieldSetElement HTMLFontElement HTMLFormControlsCollection HTMLFormElement HTMLFrameElement HTMLFrameSetElement HTMLHRElement HTMLHeadElement HTMLHeadingElement HTMLHtmlElement HTMLIFrameElement HTMLImageElement HTMLInputElement HTMLKeygenElement HTMLLIElement HTMLLabelElement HTMLLegendElement HTMLLinkElement HTMLMapElement HTMLMarqueeElement HTMLMediaElement HTMLMenuElement HTMLMetaElement HTMLMeterElement HTMLModElement HTMLOListElement HTMLObjectElement HTMLOptGroupElement HTMLOptionElement HTMLOptionsCollection HTMLOutputElement HTMLParagraphElement HTMLParamElement HTMLPictureElement HTMLPreElement HTMLProgressElement HTMLQuoteElement HTMLScriptElement HTMLSelectElement HTMLShadowElement HTMLSlotElement HTMLSourceElement HTMLSpanElement HTMLStyleElement HTMLTableCaptionElement HTMLTableCellElement HTMLTableColElement HTMLTableElement HTMLTableRowElement HTMLTableSectionElement HTMLTemplateElement HTMLTextAreaElement HTMLTitleElement HTMLTrackElement HTMLUListElement HTMLUnknownElement HTMLVideoElement HashChangeEvent Headers History IDBCursor IDBCursorWithValue IDBDatabase IDBFactory IDBIndex IDBKeyRange IDBObjectStore IDBOpenDBRequest IDBRequest IDBTransaction IDBVersionChangeEvent IIRFilterNode IdleDeadline Image ImageBitmap ImageData InputDeviceCapabilities IntersectionObserver IntersectionObserverEntry Intl KeyboardEvent Location MIDIAccess MIDIConnectionEvent MIDIInput MIDIInputMap MIDIMessageEvent MIDIOutput MIDIOutputMap MIDIPort MediaDevices MediaElementAudioSourceNode MediaEncryptedEvent MediaError MediaKeyMessageEvent MediaKeySession MediaKeyStatusMap MediaKeySystemAccess MediaKeys MediaList MediaQueryList MediaQueryListEvent MediaRecorder MediaSource MediaStreamAudioDestinationNode MediaStreamAudioSourceNode MediaStreamEvent MediaStreamTrack MessageChannel MessageEvent MessagePort MimeType MimeTypeArray MouseEvent MutationEvent MutationObserver MutationRecord NamedNodeMap Navigator Node NodeFilter NodeIterator NodeList Notification OfflineAudioCompletionEvent OfflineAudioContext Option OscillatorNode PR PR_SHOULD_USE_CONTINUATION PR_TAB_WIDTH PR_normalizedHtml PageTransitionEvent PasswordCredential Path2D Performance PerformanceEntry PerformanceMark PerformanceMeasure PerformanceNavigation PerformanceObserver PerformanceObserverEntryList PerformanceResourceTiming PerformanceTiming PeriodicWave PermissionStatus Permissions Plugin PluginArray PopStateEvent Presentation PresentationAvailability PresentationConnection PresentationConnectionAvailableEvent PresentationConnectionCloseEvent PresentationRequest ProcessingInstruction ProgressEvent PromiseRejectionEvent PushManager PushSubscription PushSubscriptionOptions RTCCertificate RTCIceCandidate RTCSessionDescription RadioNodeList Range ReadableStream Request Response SVGAElement SVGAngle SVGAnimateElement SVGAnimateMotionElement SVGAnimateTransformElement SVGAnimatedAngle SVGAnimatedBoolean SVGAnimatedEnumeration SVGAnimatedInteger SVGAnimatedLength SVGAnimatedLengthList SVGAnimatedNumber SVGAnimatedNumberList SVGAnimatedPreserveAspectRatio SVGAnimatedRect SVGAnimatedString SVGAnimatedTransformList SVGAnimationElement SVGCircleElement SVGClipPathElement SVGComponentTransferFunctionElement SVGCursorElement SVGDefsElement SVGDescElement SVGDiscardElement SVGElement SVGEllipseElement SVGFEBlendElement SVGFEColorMatrixElement SVGFEComponentTransferElement SVGFECompositeElement SVGFEConvolveMatrixElement SVGFEDiffuseLightingElement SVGFEDisplacementMapElement SVGFEDistantLightElement SVGFEDropShadowElement SVGFEFloodElement SVGFEFuncAElement SVGFEFuncBElement SVGFEFuncGElement SVGFEFuncRElement SVGFEGaussianBlurElement SVGFEImageElement SVGFEMergeElement SVGFEMergeNodeElement SVGFEMorphologyElement SVGFEOffsetElement SVGFEPointLightElement SVGFESpecularLightingElement SVGFESpotLightElement SVGFETileElement SVGFETurbulenceElement SVGFilterElement SVGForeignObjectElement SVGGElement SVGGeometryElement SVGGradientElement SVGGraphicsElement SVGImageElement SVGLength SVGLengthList SVGLineElement SVGLinearGradientElement SVGMPathElement SVGMarkerElement SVGMaskElement SVGMatrix SVGMetadataElement SVGNumber SVGNumberList SVGPathElement SVGPatternElement SVGPoint SVGPointList SVGPolygonElement SVGPolylineElement SVGPreserveAspectRatio SVGRadialGradientElement SVGRect SVGRectElement SVGSVGElement SVGScriptElement SVGSetElement SVGStopElement SVGStringList SVGStyleElement SVGSwitchElement SVGSymbolElement SVGTSpanElement SVGTextContentElement SVGTextElement SVGTextPathElement SVGTextPositioningElement SVGTitleElement SVGTransform SVGTransformList SVGUnitTypes SVGUseElement SVGViewElement SVGViewSpec Screen ScreenOrientation ScriptProcessorNode SecurityPolicyViolationEvent Selection ServiceWorker ServiceWorkerContainer ServiceWorkerMessageEvent ServiceWorkerRegistration ShadowRoot SharedWorker SiteBoundCredential SourceBuffer SourceBufferList SpeechSynthesisEvent SpeechSynthesisUtterance Storage StorageEvent StyleSheet StyleSheetList SubtleCrypto SyncManager Text TextDecoder TextEncoder TextEvent TextMetrics TextTrack TextTrackCue TextTrackCueList TextTrackList TimeRanges Touch TouchEvent TouchList TrackEvent TransitionEvent TreeWalker UIEvent URL URLSearchParams VTTCue ValidityState WaveShaperNode WebGLActiveInfo WebGLBuffer WebGLContextEvent WebGLFramebuffer WebGLProgram WebGLRenderbuffer WebGLShader WebGLShaderPrecisionFormat WebGLTexture WebGLUniformLocation WebKitAnimationEvent WebKitCSSMatrix WebKitMutationObserver WebKitTransitionEvent WebSocket WheelEvent Window Worker XMLDocument XMLHttpRequest XMLHttpRequestEventTarget XMLHttpRequestUpload XMLSerializer XPathEvaluator XPathExpression XPathResult XSLTProcessor __REACT_DEVTOOLS_GLOBAL_HOOK__ _pr_isIE6 alert applicationCache atob blur btoa caches cancelAnimationFrame cancelIdleCallback captureEvents chrome clear clearInterval clearTimeout clientInformation close closed confirm console copy createImageBitmap crypto customElements debug defaultStatus defaultstatus devicePixelRatio dir dirxml document escape event external fetch find focus frameElement frames getComputedStyle getEventListeners getMatchedCSSRules getSelection history indexedDB innerHeight innerWidth inspect isSecureContext keys length localStorage location locationbar matchMedia menubar monitor monitorEvents moveBy moveTo name navigator offscreenBuffering onabort onanimationend onanimationiteration onanimationstart onbeforeunload onblur oncancel oncanplay oncanplaythrough onchange onclick onclose oncontextmenu oncuechange ondblclick ondevicemotion ondeviceorientation ondeviceorientationabsolute ondrag ondragend ondragenter ondragleave ondragover ondragstart ondrop ondurationchange onemptied onended onerror onfocus onhashchange oninput oninvalid onkeydown onkeypress onkeyup onlanguagechange onload onloadeddata onloadedmetadata onloadstart onmessage onmousedown onmouseenter onmouseleave onmousemove onmouseout onmouseover onmouseup onmousewheel onoffline ononline onpagehide onpageshow onpause onplay onplaying onpopstate onprogress onratechange onrejectionhandled onreset onresize onscroll onsearch onseeked onseeking onselect onshow onstalled onstorage onsubmit onsuspend ontimeupdate ontoggle ontransitionend onunhandledrejection onunload onvolumechange onwaiting onwebkitanimationend onwebkitanimationiteration onwebkitanimationstart onwebkittransitionend onwheel open openDatabase opener outerHeight outerWidth pageXOffset pageYOffset parent performance personalbar postMessage print profile profileEnd prompt releaseEvents requestAnimationFrame requestIdleCallback resizeBy resizeTo screen screenLeft screenTop screenX screenY scroll scrollBy scrollTo scrollX scrollY scrollbars self sessionStorage setInterval setTimeout speechSynthesis status statusbar stop styleMedia table title toolbar top undebug unescape unmonitor unmonitorEvents values webkitAudioContext webkitCancelAnimationFrame webkitCancelRequestAnimationFrame webkitIDBCursor webkitIDBDatabase webkitIDBFactory webkitIDBIndex webkitIDBKeyRange webkitIDBObjectStore webkitIDBRequest webkitIDBTransaction webkitIndexedDB webkitMediaStream webkitOfflineAudioContext webkitRTCPeerConnection webkitRequestAnimationFrame webkitRequestFileSystem webkitResolveLocalFileSystemURL webkitSpeechGrammar webkitSpeechGrammarList webkitSpeechRecognition webkitSpeechRecognitionError webkitSpeechRecognitionEvent webkitStorageInfo webkitURL window |
You’ve likely used Node already but did you have any idea how much stuff it comes with? Below is a tiny sampling; check the official documentation for all the details.
Module | Classes |
---|---|
buffer | Buffer |
child_process | ChildProcess |
cluster | Worker |
console | Console |
crypto | Certificate Cipher Decipher DiffieHellman EDCH Hash Hmac Sign Verify |
dgram | Socket |
events | EventEmitter |
fs | Watcher ReadStream Stats WriteStream |
http | Agent ClientRequest Server ServerResponse IncomingMessage |
https | Agent Server |
net | Server Socket |
readline | Interface |
repl | REPLServer |
stream | Writable Readable Duplex Transform PassThrough |
string_decoder | StringDecoder |
timers | Immediate Timeout |
tls | Server Socket |
tty | ReadStream WriteStream |
vm | Script |
zlib | Deflate DeflateRaw Gunzip Gzip Inflate InflateRaw Unzip Zlib |