Show Menu
Cheatography

JavaScript Cheat Sheet (DRAFT) by

It contains different JS object , methods and description.

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Mouse Events

click
The click event is fired when a mouse button is pressed and released on a single element.
dblclick
The dblclick event is fired when mouse button is clicked twice on a single element.
mousedown
The mousedown event is fired when a mouse button is pressed on an element
mousemove
The mousemove event is fired when a mouse is moved while over an element
mouseover
The mouseover event is fired when a mouse is moved onto the element that has the listener attached or onto one of its children.
mouseout
The mouseout event is fired when a mouse is moved off the element that has the listener attached or off one of its children.
mouseup
The mouseup event is fired when a mouse button is released over an element.

Keyboard Events

keydown
The keydown event is fired when a key is pressed down.
keypress
The keypress event is fired when a key is pressed down and that key normally produces a character value.
keyup
The keyup event is fired when a key is released.
 

Basic Objects

Array
 
Properties
constructor
creates a new Function object.
new Function ([arg1[, arg2[, ...argN]],] functionBody)
length
number of arguments expected by the function.
consol­e.log ( Functi­on.l­ength );
prototype
Prototype for the Array constr­uctor.
Array.i­sA­rra­y(A­rra­y.p­rot­otype);
Array
 
Methods
concat()
returns a new array comprised of this array joined with other array(s) and/or value(s).
arr.co­nca­t(v­alue1, value2, ..., valueN)
indexof()
returns the first index at which a given element can be found in the array.
arr.in­dex­Of(­sea­rch­Ele­ment[, fromIn­dex])
join()
joins all elements of an array into a string.
str = arr.jo­in(­sep­arator)
lastindexof()
returns the last index at which a given element can be found in the array.
array.l­as­tIn­dex­Of(­sea­rch­Ele­ment[, fromIn­dex])
pop
removes the last element from an array
arr.pop()
push()
adds one or more elements to the end of an array and returns the new length of the array.
arr.pu­sh(­ele­ment1, ..., elementN)