JavaScript Cheat Sheetby Dave Child (DaveChild) via cheatography.com/1/cs/7/

Regular Expres​sions Syntax

Pattern Modifiers (cont)

JavaScript Arrays^x*

Allow comments and whitespace inconcat()slice()

patternjoin()

sort()

Evaluate replac​ement

lengthsplice()Ungreedy pattern

pop()

toSource()push()

toString()

reverse()unshift()

shift()

valueOf()

Start of string$

End of string.

Any single charactere*(a|b)a or b

U*(...)

Group section* PCRE modifier[abc]

In range (a, b or c)[^abc]

Not in range\sWhite spacea?

Zero or one of aa*

Zero or more of aa*?

Zero or more, ungreedya+One or more of aa+?

One or more, ungreedya{3}Exactly 3 of aa{3,}3 or more of aa{,6}Up to 6 of aa{3,6}

3 to 6 of aa{3,6}?

3 to 6 of a, ungreedy\Escape character[:punct:]

Any punctu​ation symbol[:space:]

Any space character[:blank:]

Space or tab

There's an excellent regular expression
tester at: http:/​/re​gex​pal.com/
Pattern ModifiersgGlobal matchi*Case-i​nse​nsitivem*Multiple liness*

Treat string as single line

JavaScript RegExp Objectcompile()

lastParenexec()

leftCO​ntext

JavaScript Numbers and Maths

globalmultiline

abs()

min()

ignoreCaserightC​ontext

acos()NEGATI​VE_​INF​INITY

input

sourceasin()PI

lastIndex

test()

atan()POSITI​VE_​INF​INITY

atan2()pow()

ceil()

random()cos()

round()

E

sin()

exp()

sqrt()

floor()SQRT1_2

LN10

SQRT2

LN2

tan()

log()

toSource()

LOG10E

toExpo​nen​tial()

LOG2E

toFixed()max()

toPrec​ision()

MAX_VALUE

toString()

MIN_VALUE

valueOf()

lastMatch
JavaScript Event Handlers
onabortonmous​edown

onbluronmous​emove

onchange

onmouseout

onclick

onmous​eover

ondblclick

onmouseup

ondragdrop

onmoveonerroronresetonfocusonresizeonkeydown

onselectonkeypress

onsubmit

onkeyuponunload

onloadNaN

By Dave Child (DaveChild)

Published 19th October, 2011.

Sponsored by Readable.com

cheatography.com/davechild/

Last updated 11th May, 2016.

Measure your website readability!

aloneonahill.com

Page 1 of 2.

https://readable.com

JavaScript Cheat Sheetby Dave Child (DaveChild) via cheatography.com/1/cs/7/

JavaScript Booleans
toSource()

JavaScript Strings
valueOf()

toString()
JavaScript Dates

charAt()slice()

charCo​deAt()

split() x

concat()substr()fromCh​arC​ode()

substr​ing()

indexOf()

toLowe​rCase()

lastIn​dexOf()

toUppe​rCase()

lengthtoLoca​leL​owe​rCase()locale​Com​pare()toLoca​leU​ppe​rCase()match() x

toSource()

replace() xvalueOf()

Date()

setMonth()

getDate()setFul​lYear()

getDay()setHours()

getMonthsetMin​utes()

getFul​lYear

setSec​onds()

getYearsetMil​lis​eco​nds()

getHours

setTime()getMinutes

setUTC​Date()

getSeconds

setUTC​Day()

getMil​lis​econds

setUTC​Month()

getTimesetUTC​Ful​lYear()

JavaScript Functions

getTim​ezo​neO​‐

setUTC​Hours()

decode​URI()

isNaN()

decode​URI​Com​pon​ent()

Number()ffset()

search() x
String object methods with an x support
regular expres​sions.

getUTC​Date()

setUTC​Min​utes()

encode​URI()

parseF​loat()getUTC​Day()

setUTC​Sec​onds()

encode​URI​Com​pon​ent()parseInt()

getUTC​Month()

setUTC​Mil​lis​eco​‐

escape()String()eval()

unescape()

nds()
getUTC​Ful​lYear()

toSource()

getUTC​Hours()

toString()

getUTC​Min​utes()

toGMTS​tring()

getUTC​Sec​onds()

toUTCS​tring()

getUTC​Mil​lis​eco​‐

toLoca​leS​tring()

isFinite()nds()
parse()

UTC()

setDate()valueOf()
By Dave Child (DaveChild)

Published 19th October, 2011.

Sponsored by Readable.com

cheatography.com/davechild/

Last updated 11th May, 2016.

Measure your website readability!

aloneonahill.com

Page 2 of 2.

https://readable.com