JavaScript Cheat Sheet
by Dave Child (DaveChild) via cheatography.com/1/cs/7/
Regular Expressions 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 replacement 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() leftCOntext JavaScript Numbers and Maths
a? Zero or one of a
global multiline abs() min()
a* Zero or more of a
ignoreCase rightContext acos() NEGATIVE_INFINITY
a*? Zero or more, ungreedy
input source asin() PI
a+ One or more of a
lastIndex test() atan() POSITIVE_INFINITY
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 onmousedown
E sin()
a{3,6} 3 to 6 of a
onblur onmousemove
exp() sqrt()
a{3,6}? 3 to 6 of a, ungreedy
onchange onmouseout
floor() SQRT1_2
\ Escape character
onclick onmouseover
LN10 SQRT2
[:punct:] Any punctuation symbol
ondblclick onmouseup
LN2 tan()
[:space:] Any space character
ondragdrop onmove
log() toSource()
[:blank:] Space or tab
onerror onreset
LOG10E toExponential()
There's an excellent regular expression
onfocus onresize
tester at: http://regexpal.com/ LOG2E toFixed()
onkeydown onselect
max() toPrecision()
Pattern Modifiers onkeypress onsubmit
MAX_VALUE toString()
onkeyup onunload
g Global match MIN_VALUE valueOf()
onload
i* Case-insensitive NaN
m* Multiple lines
s* Treat string as single line
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 Sheet
by Dave Child (DaveChild) via cheatography.com/1/cs/7/
JavaScript Booleans JavaScript Strings
toSource() valueOf() charAt() slice()
toString() charCodeAt() split() x
concat() substr()
JavaScript Dates
fromCharCode() substring()
Date() setMonth()
indexOf() toLowerCase()
getDate() setFullYear()
lastIndexOf() toUpperCase()
getDay() setHours()
length toLocaleLowerCase()
getMonth setMinutes()
localeCompare() toLocaleUpperCase()
getFullYear setSeconds()
match() x toSource()
getYear setMilliseconds()
replace() x valueOf()
getHours setTime()
search() x
getMinutes setUTCDate()
String object methods with an x support
getSeconds setUTCDay() regular expressions.
getMilliseconds setUTCMonth()
getTime setUTCFullYear() JavaScript Functions
getTimezoneO‐ setUTCHours() decodeURI() isNaN()
ffset() decodeURIComponent() Number()
getUTCDate() setUTCMinutes() encodeURI() parseFloat()
getUTCDay() setUTCSeconds() encodeURIComponent() parseInt()
getUTCMonth() setUTCMilliseco‐ escape() String()
nds()
eval() unescape()
getUTCFullYear() toSource()
isFinite()
getUTCHours() toString()
getUTCMinutes() toGMTString()
getUTCSeconds() toUTCString()
getUTCMilliseco‐ toLocaleString()
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