0% found this document useful (0 votes)
16 views2 pages

Javascript Cheat Sheet

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views2 pages

Javascript Cheat Sheet

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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() leftContext
​ 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

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


JavaScript Event Handlers
a{,6} Up to 6 of a cos() round()
onAbort onMous​eDown
a{3,6} 3 to 6 of a E sin()
onBlur onMous​eMove
a{3,6}? 3 to 6 of a, ungreedy exp() sqrt()
onChange onMouseOut
\ Escape character floor() SQRT1_2
onClick onMous​eOver
[:punct:] Any punctu​ation symbol LN10 SQRT2
onDblClick onMouseUp
[:space:] Any space character LN2 tan()
onDragDrop onMove
[:blank:] Space or tab log() toSource()
onError onReset
LOG10E toExpo​nen​tial()
There's an excellent regular expression tester
onFocus onResize
at: http:/​/re​gex​pal.com/ LOG2E toFixed()
onKeyDown onSelect
max() toPrec​ision()
Pattern Modifiers onKeyPress onSubmit
MAX_VALUE toString()
g Global match onKeyUp onUnload
MIN_VALUE valueOf()
i* Case-i​nse​nsitive onLoad
NaN
m* Multiple lines

s* Treat string as single line

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


cheatography.com/davechild/ Last updated 28th June, 2014. Measure your website readability!
www.addedbytes.com Page 1 of 2. https://readability-score.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 regular
getSeconds setUTC​Day() expres​sions.
getMil​lis​econds setUTC​Month()

getTime setUTC​Ful​lYear() JavaScript Functions

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

getUTC​Date() setUTC​Min​utes() decode​URI​Com​pon​ent() Number()

getUTC​Day() setUTC​Sec​onds() encode​URI() parseF​loat()

getUTC​Month() setUTC​Mil​lis​eco​nds() encode​URI​Com​pon​ent() parseInt()

getUTC​Ful​lYear() toSource() escape() String()

getUTC​Hours() toString() eval() unescape()

getUTC​Min​utes() toGMTS​tring() isFinite()

getUTC​Sec​onds() toUTCS​tring()

getUTC​Mil​lis​eco​nds() toLoca​leS​tring()

parse() UTC()

setDate() valueOf()

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


cheatography.com/davechild/ Last updated 28th June, 2014. Measure your website readability!
www.addedbytes.com Page 2 of 2. https://readability-score.com

You might also like