You are on page 1of 2

JavaScript Cheat Sheet

by Dave Child (DaveChild) via cheatography.com/1/cs/7/

Regular Expres​sions Syntax Pattern Modifiers (cont) JavaScript Arrays

^ Start of string x* Allow comments and whitespace in concat() slice()


$ End of string pattern join() sort()
. Any single character e* Evaluate replac​ement length splice()

(a|b) a or b U* Ungreedy pattern pop() toSource()


(...) Group section * PCRE modifier push() toString()
[abc] In range (a, b or c) reverse() unshift()
JavaScript RegExp Object
[^abc] Not in range shift() valueOf()
compile() lastParen
\s White space
exec() leftCO​ntext JavaScript Numbers and Maths
a? Zero or one of a
global multiline abs() min()
a* Zero or more of a
ignoreCase rightC​ontext acos() NEGATI​VE_​INF​INITY
a*? Zero or more, ungreedy
input source asin() PI
a+ One or more of a
lastIndex test() atan() POSITI​VE_​INF​INITY
a+? One or more, ungreedy
lastMatch atan2() pow()
a{3} Exactly 3 of a
ceil() random()
a{3,} 3 or more of a
JavaScript Event Handlers
cos() round()
a{,6} Up to 6 of a
onabort onmous​edown
E sin()
a{3,6} 3 to 6 of a
onblur onmous​emove
exp() sqrt()
a{3,6}? 3 to 6 of a, ungreedy
onchange onmouseout
floor() SQRT1_2
\ Escape character
onclick onmous​eover
LN10 SQRT2
[:punct:] Any punctu​ation symbol
ondblclick onmouseup
LN2 tan()
[:space:] Any space character
ondragdrop onmove
log() toSource()
[:blank:] Space or tab
onerror onreset
LOG10E toExpo​nen​tial()
There's an excellent regular expression
onfocus onresize
tester at: http:/​/re​gex​pal.com/ LOG2E toFixed()
onkeydown onselect
max() toPrec​ision()
Pattern Modifiers onkeypress onsubmit
MAX_VALUE toString()
onkeyup onunload
g Global match MIN_VALUE valueOf()
onload
i* Case-i​nse​nsitive NaN
m* Multiple lines
s* Treat string as single line

By Dave Child (DaveChild) Published 19th October, 2011. Sponsored by CrosswordCheats.com


cheatography.com/davechild/ Last updated 11th May, 2016. Learn to solve cryptic crosswords!
aloneonahill.com Page 1 of 2. http://crosswordcheats.com
JavaScript Cheat Sheet
by Dave Child (DaveChild) via cheatography.com/1/cs/7/

JavaScript Booleans JavaScript Strings

toSource() valueOf() charAt() slice()


toString() charCo​deAt() split() x
concat() substr()
JavaScript Dates
fromCh​arC​ode() substr​ing()
Date() setMonth()
indexOf() toLowe​rCase()
getDate() setFul​lYear()
lastIn​dexOf() toUppe​rCase()
getDay() setHours()
length toLoca​leL​owe​rCase()
getMonth setMin​utes()
locale​Com​pare() toLoca​leU​ppe​rCase()
getFul​lYear setSec​onds()
match() x toSource()
getYear setMil​lis​eco​nds()
replace() x valueOf()
getHours setTime()
search() x
getMinutes setUTC​Date()
String object methods with an x support
getSeconds setUTC​Day() regular expres​sions.
getMil​lis​econds setUTC​Month()
getTime setUTC​Ful​lYear() JavaScript Functions

getTim​ezo​neO​‐ setUTC​Hours() decode​URI() isNaN()


ffset() decode​URI​Com​pon​ent() Number()
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()
nds()
eval() unescape()
getUTC​Ful​lYear() toSource()
isFinite()
getUTC​Hours() toString()
getUTC​Min​utes() toGMTS​tring()
getUTC​Sec​onds() toUTCS​tring()
getUTC​Mil​lis​eco​‐ toLoca​leS​tring()
nds()
parse() UTC()
setDate() valueOf()

By Dave Child (DaveChild) Published 19th October, 2011. Sponsored by CrosswordCheats.com


cheatography.com/davechild/ Last updated 11th May, 2016. Learn to solve cryptic crosswords!
aloneonahill.com Page 2 of 2. http://crosswordcheats.com

You might also like