Anda di halaman 1dari 2

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()


e* Evaluate replacement
. Any single character length splice()
U* Ungreedy pattern
(a|b) a or b 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

a{3,} 3 or more of a ceil() random()


JavaScript Event Handlers
a{,6} Up to 6 of a cos() round()
onabort onmousedown
a{3,6} 3 to 6 of a E sin()
onblur onmousemove
a{3,6}? 3 to 6 of a, ungreedy exp() sqrt()
onchange onmouseout
\ Escape character floor() SQRT1_2
onclick onmouseover
[:punct:] Any punctuation symbol LN10 SQRT2
ondblclick onmouseup
[:space:] Any space character LN2 tan()
ondragdrop onmove
[:blank:] Space or tab log() toSource()
onerror onreset
LOG10E toExponential()
There's an excellent regular expression tester
onfocus onresize
at: http://regexpal.com/ LOG2E toFixed()
onkeydown onselect
max() toPrecision()
Pattern Modifiers onkeypress onsubmit
MAX_VALUE toString()
g Global match onkeyup onunload
MIN_VALUE valueOf()
i* Case-insensitive onload
NaN
m* Multiple lines

s* Treat string as single line

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


cheatography.com/davechild/ Last updated 11th May, 2016. Everyone has a novel in them. Finish Yours!
www.getpostcookie.com Page 1 of 2. https://apollopad.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 regular
getSeconds setUTCDay() expressions.
getMilliseconds setUTCMonth()
JavaScript Functions
getTime setUTCFullYear()

getTimezoneOffset() setUTCHours() decodeURI() isNaN()

getUTCDate() setUTCMinutes() decodeURIComponent() Number()

getUTCDay() setUTCSeconds() encodeURI() parseFloat()

getUTCMonth() setUTCMilliseconds() encodeURIComponent() parseInt()

getUTCFullYear() toSource() escape() String()

getUTCHours() toString() eval() unescape()

getUTCMinutes() toGMTString() isFinite()

getUTCSeconds() toUTCString()

getUTCMilliseconds() toLocaleString()

parse() UTC()

setDate() valueOf()

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


cheatography.com/davechild/ Last updated 11th May, 2016. Everyone has a novel in them. Finish Yours!
www.getpostcookie.com Page 2 of 2. https://apollopad.com

Anda mungkin juga menyukai