JavaScript Standard Objects

You don’t have to do everything from scratch. So many objects are already there waiting for you to use them. What are these objects?

ECMAScript Standard Objects

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:

NamePrototypeProperties
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()
ObjectFunction.
prototype
prototype create() assign() is() getPrototypeOf() setPrototypeOf() defineProperties() defineProperty() getOwnPropertyDescriptor() getOwnPropertyDescriptors() getOwnPropertyNames() getOwnPropertySymbols() keys() values() entries() preventExtensions() isExtensible() seal() isSealed() freeze() isFrozen()
Object.prototypenullconstructor toString() toLocaleString() valueOf() hasOwnProperty() isPrototypeOf() propertyIsEnumerable()
MathObject.
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()
JSONObject.
prototype
parse() stringify()
ReflectObject.
prototype
getPrototypeOf() setPrototypeOf() construct() ownKeys() has() defineProperty() getOwnPropertyDescriptor() get() set() apply() deleteProperty() isExtensible() preventExtensions()
AtomicsObject.
prototype
add() and() compareExchange() exchange() isLockFree() load() or() store() sub() wait() wake() xor()
FunctionFunction.
prototype
length prototype
Function.prototypeObject.
prototype
constructor toString() apply() call() bind()
Function instancesFunction.
prototype
name length prototype
BooleanFunction.
prototype
prototype
Boolean.prototypeObject.
prototype
constructor toString() valueOf()
NumberFunction.
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.prototypeObject.
prototype
constructor toString() toLocaleString() valueOf() toFixed() toExponential() toPrecision()
BigIntFunction.
prototype
prototype asIntN() asUintN()
BigInt.prototypeObject.
prototype
constructor toString() toLocaleString() valueOf()
StringFunction.
prototype
prototype fromCharCode() fromCodePoint() raw()
String.prototypeObject.
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 instancesString.
prototype
length
SymbolFunction.
prototype
prototype hasInstance isConcatSpreadable iterator asyncIterator match replace search species split() toPrimitive toStringTag unscopables for() keyFor()
Symbol.prototypeObject.
prototype
constructor toString() valueOf()
RegExpFunction.
prototype
prototype
RegExp.prototypeObject.
prototype
constructor flags global ignoreCase unicode multiline sticky dotAll source test() exec() toString()
RegExp instancesRegExp.
prototype
lastIndex
DateFunction.
prototype
prototype parse() UTC() now()
Date.prototypeObject.
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()
ArrayFunction.
prototype
prototype isArray() of() from()
Array.prototypeObject.
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 instancesArray.
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()
SetFunction.
prototype
prototype
Set.prototypeObject.
prototype
constructor size has() keys() values() entries() add() clear() delete() forEach()
ArrayBufferFunction.
prototype
prototype isView
ArrayBuffer.prototypeObject.
prototype
constructor byteLength slice()
SharedArrayBufferFunction.
prototype
prototype
SharedArrayBuffer.prototypeObject.
prototype
constructor byteLength slice()
DataViewFunction.
prototype
prototype
DataView.prototypeObject.
prototype
constructor buffer byteLength byteOffset getInt8() setInt8() getInt16() setInt16() getInt32() setInt32() getUint8() setUint8() getUint16() setUint16() getUint32() setUint32() setFloat64() setFloat32() getFloat64() getFloat32()
WeakSetFunction.
prototype
prototype
WeakSet.prototypeObject.
prototype
constructor has() add() has() delete()
MapFunction.
prototype
prototype
Map.prototypeObject.
prototype
constructor size has() get() set() keys() values() entries() clear() delete() forEach()
WeakMapFunction.
prototype
prototype
WeakMap.prototypeObject.
prototype
constructor has() get() set() delete()
ProxyFunction.
prototype
revocable()
Proxy.prototypeObject.
prototype
PromiseFunction.
prototype
prototype all() race() resolve() reject()
Promise.prototypeObject.
prototype
constructor then() catch()
ErrorFunction.
prototype
prototype
Error.prototypeObject.
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

Typical Browser Objects

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

Node.js Objects

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.

ModuleClasses
bufferBuffer
child_processChildProcess
clusterWorker
consoleConsole
cryptoCertificate Cipher Decipher DiffieHellman EDCH Hash Hmac Sign Verify
dgramSocket
eventsEventEmitter
fsWatcher ReadStream Stats WriteStream
httpAgent ClientRequest Server ServerResponse IncomingMessage
httpsAgent Server
netServer Socket
readlineInterface
replREPLServer
streamWritable Readable Duplex Transform PassThrough
string_decoderStringDecoder
timersImmediate Timeout
tlsServer Socket
ttyReadStream WriteStream
vmScript
zlibDeflate DeflateRaw Gunzip Gzip Inflate InflateRaw Unzip Zlib