JavaScript cheat sheet for newbies learning JavaScript. This JavaScript cheat sheet is made by DavidChild from cheatography.com
Regular Expressions Syntax
^ Start of string
$ End of string
. Anysingle character
(a|b) a or b
(...) Groupsection
[abc] Inrange (a, b or c)
[^abc] Not inrange
s Whitespace
a? Zero or one of a
a* Zero ormore of a
a*? Zero ormore,ungreedy
a+ One ormore of a
a+? One ormore,ungreedy
a{3} Exactly 3 of a
a{3,} 3 ormore of a
a{,6} Up to 6 of a
a{3,6} 3 to 6 of a
a{3,6}? 3 to 6 of a,ungreedy
Escapecharacter
[:punct:] Anypunctuation symbol
[:space:] Anyspace character
[:blank:] Space or tab
JavaScript Event Handlers
onabort onmousedown
onblur onmousemove
onchange onmouseout
onclick onmouseover
ondblclick onmouseup
ondragdrop onmove
onfocus onresize
onerror onreset
onkeypress onsubmit
onkeydown onselect
onkeyup onunload
onload
JavaScript Dates
Date() setMonth()
getDate() setFullYear()
getDay() setHours()
getMonth setMinutes()
getFullYear setSeconds()
getYear setMilliseconds()
getHours setTime()
getMinutes setUTCDate()
getSeconds setUTCDay()
getMilliseconds setUTCMonth()
getTime setUTCFullYear()
getTimezoneOffset() setUTCHours()
getUTCDate() setUTCMinutes()
getUTCDay() setUTCSeconds()
getUTCMonth() setUTCMilliseconds()
getUTCFullYear() toSource()
getUTCHours() toString()
getUTCMinutes() toGMTString()
getUTCSeconds() toUTCString()
getUTCMilliseconds()toLocaleString()
parse() UTC()
setDate() valueOf()
Pattern Modifiers
g Globalmatch
i* Case-insensitive
m* Multiplelines
s* Treat string assingle line
x* Allowcomments andwhitespace inpattern
e* Evaluatereplacement
U* Ungreedypattern
JavaScript Arrays
concat() slice()
join() sort()
length splice()
pop() toSource()
push() toString()
reverse()unshift()
shift() valueOf()
JavaScript Strings
charAt() slice()
charCodeAt() split() x
concat() substr()
fromCharCode()substring()
indexOf() toLowerCase()
lastIndexOf() toUpperCase()
length toLocaleLowerCase()
localeCompare()toLocaleUpperCase()
match()x toSource()
replace()x valueOf()
search() x
JavaScript RegExp Object
compile() lastParen
exec() leftCOntext
global multiline
ignoreCase rightContext
input source
lastIndex test()
lastMatch
JavaScript Numbers and Maths
abs() min()
acos() NEGATIVE_INFINITY
asin() PI
atan() POSITIVE_INFINITY
atan2() pow()
ceil() random()
cos() round()
E sin()
exp() sqrt()
floor() SQRT1_2
LN10 SQRT2
LN2 tan()
log() toSource()
LOG10E toExponential()
LOG2E toFixed()
max() toPrecision()
MAX_VALUE toString()
MIN_VALUE valueOf()
NaN
JavaScript Booleans
toSource() valueOf()
toString()
JavaScript Functions
decodeURI() isNaN()
decodeURIComponent() Number()
encodeURI() parseFloat()
encodeURIComponent() parseInt()
escape() String()
eval() unescape()
isFinite()
No comments
Post a Comment