Quick Reference to JavaScript Objects
his page provides an alphabetized list for JavaScript’s:
- built-in objects
- browser-specific objects
- object’s properties
- object’s methods
JavaScript Object | JavaScript Properties | JavaScript Methods |
---|---|---|
anchor | name | – |
text | – | |
x | – | |
y | – | |
area | hash | – |
host | – | |
hostname | – | |
href | – | |
pathname | – | |
port | – | |
protocol | – | |
search | – | |
target | – | |
array | constructor | concat() , join() , pop() , push() , reverse() , shift() , slice() , splice() , sort() , toSource() , toString() , unshift() , valueOf() |
index | ||
input | ||
length | ||
prototype | ||
Boolean | constructor | toSource() , toString() , valueOf() |
prototype | ||
button | form | blur() , click() , focus() , handleEvent() |
name | ||
type | ||
value | ||
checkbox | checked | blur() , click() , focus() , handleEvent() |
defaultChecked | ||
form | ||
name | ||
type | ||
value | ||
Date | constructor | getDate() , getDay() , getFullYear() , getHours() , getMilliseconds() , getMinutes() , getMonth() , getSeconds() , getTime() , getTimezoneOffset() , getUTCDate() , getUTCDay() , getUTCFullYear() , getUTCHours() , getUTCMilliseconds() , getUTCMinutes() , getUTCMonth() , getUTCSeconds() , getYear() , parse() , setDate() , setFullYear() , setHours() , setMilliseconds() , setMinutes() , setMonth() , setSeconds() , setTime() , setUTCDate() , setUTCFullYear() , setUTCHours() , setUTCMilliseconds() , setUTCMinutes() , setUTCMonth() , setUTCSeconds() , setYear() , toGMTString() , toLocaleString() , toSource() , toString() , toUTCString() , UTC() , valueOf() |
prototype | ||
document | alinkColor | captureEvents() , close() , getSelection() , handleEvent() , open() , releaseEvents() , routeEvent() , write() , writeln() |
anchors | ||
applets | ||
bgColor | ||
classes | ||
cookie | ||
domain | ||
embeds | ||
fgColor | ||
forms | ||
height | ||
images | ||
lastModified | ||
layers | ||
linkColor | ||
links | ||
plugins | ||
referrer | ||
tags | ||
title | ||
URL | ||
vlinkColor | ||
width | ||
event | data | – |
height | – | |
layerX | – | |
layerY | – | |
modifiers | – | |
pageX | – | |
pageY | – | |
screenX | – | |
screenY | – | |
target | – | |
type | – | |
which | – | |
width | – | |
x | – | |
y | – | |
fileUpload | form | blur() , focus() , handleEvent() , select() |
name | ||
type | ||
value | ||
form | action | handleEvent() , reset() , submit() |
elements | ||
encoding | ||
length | ||
method | ||
name | ||
target | ||
function | arguments | apply() , call() , toSource() , toString() , valueOf() |
arguments.callee | ||
arguments.caller | ||
arguments.length | ||
arity | ||
constructor | ||
length | ||
prototype | ||
hidden | form | – |
name | – | |
type | – | |
value | – | |
history | current | back() , forward() , go() |
length | ||
next | ||
previous | ||
image | border | handleEvent() |
complete | ||
height | ||
hspace | ||
lowsrc | ||
name | ||
src | ||
vspace | ||
width | ||
layer | above | captureEvents() , handleEvent() , load() , moveAbove() , moveBelow() , moveBy() , moveTo() , moveToAbsolute() , releaseEvents() , resizeBy() , resizeTo() , routeEvent() |
background | ||
bgColor | ||
below | ||
clip.bottom | ||
clip.height | ||
clip.left | ||
clip.right | ||
clip.top | ||
clip.width | ||
document | ||
left | ||
name | ||
pageX | ||
pageY | ||
parentLayer | ||
siblingAbove | ||
siblingBelow | ||
src | ||
top | ||
visibility | ||
window | ||
x | ||
y | ||
zIndex | ||
link | hash | handleEvent() |
host | ||
hostname | ||
href | ||
pathname | ||
port | ||
protocol | ||
search | ||
target | ||
text | ||
x | ||
y | ||
location | hash | reload() , replace() |
host | ||
hostname | ||
href | ||
pathname | ||
port | ||
protocol | ||
search | ||
Math | E | abs() , acos() , asin() , atan() , ceil() , cos() , exp() , floor() , log() , max() , min() , pow() , random() , round() , sin() , sqrt() , tan() |
LN10 | ||
LN2 | ||
LOG10E | ||
LOG2E | ||
PI | ||
SQRT1_2 | ||
SQRT2 | ||
mimeType | description | – |
enabledPlugin | – | |
suffixes | – | |
type | – | |
navigator | appCodeName | javaEnabled() , plugins.refresh() , preference() , savePreferences() , taintEnabled() |
appName | ||
appVersion | ||
language | ||
mimeTypes | ||
platform | ||
plugins | ||
userAgent | ||
Number | constructor | toSource() , toString() , valueOf() |
MAX_VALUE | ||
MIN_VALUE | ||
NaN | ||
NEGATIVE_INFINITY | ||
POSITIVE_INFINITY | ||
prototype | ||
Object | constructor | eval() , toSource() , toString() , unwatch() , valueOf() , watch() |
prototype | ||
option | defaultSelected | – |
index | – | |
length | – | |
selected | – | |
text | – | |
value | – | |
password | defaultValue | blur() , focus() , handleEvent() , select() |
form | ||
name | ||
type | ||
value | ||
plugin | description | – |
filename | – | |
length | – | |
name | – | |
radio | checked | blur() , click() , focus() , handleEvent() |
defaultChecked | ||
form | ||
name | ||
type | ||
value | ||
RegExp | $1...$9 | compile() , exec() , test() , toSource() , toString() , valueOf() |
$_ | ||
$* | ||
$& | ||
$+ | ||
$' | ||
$' | ||
constructor | ||
global | ||
ignoreCase | ||
input | ||
lastIndex | ||
lastMatch | ||
lastParen | ||
leftContext | ||
multiline | ||
prototype | ||
rightContext | ||
source | ||
reset | form | blur() , click() , focus() , handleEvent() |
name | ||
type | ||
value | ||
screen | availHeight | – |
availLeft | – | |
availTop | – | |
availWidth | – | |
colorDepth | – | |
height | – | |
pixelDepth | – | |
width | – | |
select | form | blur() , focus() , handleEvent() |
length | ||
name | ||
options | ||
selectedIndex | ||
type | ||
String | constructor | anchor() , big() , blink() , bold() , charAt() , charCodeAt() , concat() , fixed() , fontcolor() , fontsize() , fromCharCode() , indexOf() , italics() , lastIndexOf() , link() , match() , replace() , search() , slice() , small() , split() , strike() , sub() , substr() , substring() , sup() , toLowerCase() , toSource() , toString() , toUpperCase() , valueOf() |
length | ||
prototype | ||
style | align | borderWidths() , margins() , paddings() |
backgroundColor | ||
backgroundImage | ||
borderBottomWidth | ||
borderColor | ||
borderLeftWidth | ||
borderRightWidth | ||
borderStyle | ||
borderTopWidth | ||
clear | ||
color | ||
display | ||
fontFamily | ||
fontSize | ||
fontStyle | ||
fontWeight | ||
lineHeight | ||
listStyleType | ||
marginBottom | ||
marginLeft | ||
marginRight | ||
marginTop | ||
paddingBottom | ||
paddingLeft | ||
paddingRight | ||
paddingTop | ||
textAlign | ||
textDecoration | ||
textIndent | ||
textTransform | ||
whiteSpace | ||
width | ||
submit | form | blur() , click() , focus() , handleEvent() |
name | ||
type | ||
value | ||
text | defaultValue | blur() , focus() |
form | ||
name | ||
type | ||
value | ||
textarea | defaultValue | blur() , focus() , handleEvent() , select() |
form | ||
name | ||
type | ||
value | ||
window | closed | alert() , atob() , back() , blur() , btoa() , captureEvents() , clearInterval() , clearTimeout() , close() , confirm() , crypto.random() , crypto.signText() , disableExternalCapture() , find() , focus() , forward() , handleEvent() , home() , moveBy() , moveTo() , open() , print() , prompt() , releaseEvents() , resizeBy() , resizeTo() , routeEvent() , scroll() , scrollBy() , scrollTo() , setHotKeys() , setInterval() , setResizable() , setTimeout() , setZOptions() , stop() |
crypto | ||
defaultStatus | ||
document | ||
frames | ||
history | ||
innerHeight | ||
innerWidth | ||
length | ||
location | ||
locationbar | ||
menubar | ||
name | ||
offscreenBuffering | ||
opener | ||
outerHeight | ||
outerWidth | ||
pageXOffset | ||
pageYOffset | ||
parent | ||
personalbar | ||
screenX | ||
screenY | ||
scrollbars | ||
self | ||
status | ||
statusbar | ||
toolbar | ||
top | ||
window |
Notes
- Objects: Core JavaScript objects (
Array
,Date
,Math
, etc.) and browser-specific objects (window
,document
,navigator
, etc.). - Properties: Attributes of objects (e.g.,
length
,prototype
). - Methods: Functions that objects can execute (e.g.,
push()
,getElementById()
).
Here’s a structured table listing JavaScript’s built-in objects, browser-specific objects, along with their properties and methods:
Category | Object/Property/Method | Description |
---|---|---|
Built-in Objects | Array | Used to store multiple values in a single variable. |
Array.length | Returns the number of elements in an array. | |
Array.push() | Adds one or more elements to the end of an array. | |
Date | Represents date and time functionality. | |
Date.now() | Returns the number of milliseconds since January 1, 1970. | |
Math | Provides mathematical functions and constants. | |
Math.random() | Returns a random number between 0 and 1. | |
String | Represents and manipulates a sequence of characters. | |
String.length | Returns the length of a string. | |
String.toUpperCase() | Converts a string to uppercase letters. | |
Object | Base object for all JavaScript objects. | |
Object.keys() | Returns an array of a given object’s property names. | |
Browser Objects | window | Represents the browser’s window (global object in browsers). |
window.innerHeight | Returns the height of the window’s content area. | |
window.alert() | Displays an alert box with a message. | |
document | Represents the web page loaded in the window (DOM entry point). | |
document.getElementById() | Returns the element with the specified ID. | |
navigator | Provides browser and OS information. | |
navigator.userAgent | Returns the user-agent header sent by the browser. | |
location | Provides current URL and navigation methods. | |
location.reload() | Reloads the current page. | |
Properties | length (Array/String) | Returns the number of elements/characters. |
prototype (Object) | Allows adding properties/methods to all instances of an object. | |
Methods | push() / pop() (Array) | Adds/removes elements from the end of an array. |
charAt() (String) | Returns the character at a specified index. | |
setTimeout() (window) | Calls a function after a specified delay. | |
addEventListener() (DOM) | Attaches an event handler to an element. |
Notes:
- Built-in Objects: Core JavaScript objects available in any JS environment.
- Browser Objects: Provided by the browser (e.g.,
window
,document
). - Properties: Characteristics of objects (e.g.,
length
,prototype
). - Methods: Actions objects can perform (e.g.,
push()
,alert()
).
Here’s a detailed breakdown of JavaScript objects, properties, and methods in a structured table format:
1. Built-in JavaScript Objects
Object | Description | Key Properties | Key Methods |
---|---|---|---|
Array | Stores ordered collections of values. | length (number of elements) | push() , pop() , shift() , unshift() , slice() , splice() |
Date | Handles date and time operations. | Date.now (current timestamp) | getFullYear() , getMonth() , getDate() , toISOString() |
Math | Provides mathematical functions. | Math.PI , Math.E (constants) | random() , floor() , ceil() , max() , min() |
String | Represents and manipulates text. | length (string length) | charAt() , concat() , includes() , toUpperCase() , trim() |
Object | Base object for all JS objects. | prototype (inheritance) | keys() , values() , entries() , assign() |
Number | Wrapper for numeric values. | MAX_SAFE_INTEGER , NaN | toFixed() , toString() , parseInt() |
Boolean | Represents true or false . | (None) | valueOf() |
RegExp | Handles regular expressions. | source (regex pattern) | test() , exec() |
Function | Represents a function. | length (number of args) | call() , apply() , bind() |
Promise | Handles asynchronous operations. | Promise.length | then() , catch() , finally() , all() , race() |
JSON | Parses and stringifies JSON data. | (None) | parse() , stringify() |
2. Browser-Specific Objects
Object | Description | Key Properties | Key Methods |
---|---|---|---|
window | Global object in browsers. | innerWidth , innerHeight | alert() , setTimeout() , fetch() |
document | Represents the DOM (web page). | title , URL , body | getElementById() , querySelector() , addEventListener() |
navigator | Provides browser/OS info. | userAgent , platform | geolocation.getCurrentPosition() |
localStorage | Stores data persistently in the browser. | length (number of items) | setItem() , getItem() , removeItem() |
history | Manages browser session history. | length (history entries) | back() , forward() , pushState() |
location | Provides URL info and navigation. | href , hostname , pathname | reload() , assign() , replace() |
screen | Provides display info. | width , height , colorDepth | (None) |
3. Common Object Properties & Methods
Category | Name | Description |
---|---|---|
Properties | prototype | Used to add properties/methods to all instances of an object. |
length (Array/String) | Returns the number of items/chars. | |
constructor | References the object’s constructor function. | |
Methods | toString() | Converts an object to a string. |
valueOf() | Returns the primitive value of an object. | |
hasOwnProperty() | Checks if a property belongs to the object (not inherited). | |
isPrototypeOf() | Checks if an object exists in another’s prototype chain. |
4. Commonly Used Methods by Category
Category | Method | Example Use |
---|---|---|
Array | map() | [1,2,3].map(x => x * 2) → [2,4,6] |
filter() | [1,2,3].filter(x => x > 1) → [2,3] | |
reduce() | [1,2,3].reduce((a,b) => a + b) → 6 | |
String | split() | "a,b,c".split(",") → ["a","b","c"] |
replace() | "Hello".replace("H", "J") → "Jello" | |
Object | Object.freeze() | Prevents modifying an object. |
Object.seal() | Prevents adding/deleting properties. |
Summary
- Built-in Objects: Core JS objects (
Array
,Date
,Math
, etc.). - Browser Objects: Only available in browsers (
window
,document
,localStorage
, etc.). - Properties: Describe object characteristics (
length
,prototype
). - Methods: Actions objects can perform (
push()
,getElementById()
).