Cheatography
https://cheatography.com
JavaScript methods and functions, a guide to regular expressions and the XMLHttpRequest object.
Regular Expressions Syntax
^ |
Start of string |
$ |
End of string |
. |
Any single character |
(a|b) |
a or b |
(...) |
Group section |
[abc] |
In range (a, b or c) |
[^abc] |
Not in range |
\s |
White space |
a? |
Zero or one of a |
a* |
Zero or more of a |
a*? |
Zero or more, ungreedy |
a+ |
One or more of a |
a+? |
One or more, ungreedy |
a{3} |
Exactly 3 of a |
a{3,} |
3 or more 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 |
\ |
Escape character |
[:punct:] |
Any punctuation symbol |
[:space:] |
Any space character |
[:blank:] |
Space or tab |
Pattern Modifiers
g |
Global match |
i * |
Case-insensitive |
m * |
Multiple lines |
s * |
Treat string as single line |
x * |
Allow comments and whitespace in pattern |
e * |
Evaluate replacement |
U * |
Ungreedy pattern |
JavaScript RegExp Object
compile() |
lastParen |
exec() |
leftCOntext |
global |
multiline |
ignoreCase |
rightContext |
input |
source |
lastIndex |
test() |
lastMatch |
|
|
JavaScript Event Handlers
onabort |
onmousedown |
onblur |
onmousemove |
onchange |
onmouseout |
onclick |
onmouseover |
ondblclick |
onmouseup |
ondragdrop |
onmove |
onerror |
onreset |
onfocus |
onresize |
onkeydown |
onselect |
onkeypress |
onsubmit |
onkeyup |
onunload |
onload |
JavaScript Arrays
concat() |
slice() |
join() |
sort() |
length |
splice() |
pop() |
toSource() |
push() |
toString() |
reverse() |
unshift() |
shift() |
valueOf() |
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 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() |
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 |
String object methods with an x support regular expressions.
JavaScript Functions
decodeURI() |
isNaN() |
decodeURIComponent() |
Number() |
encodeURI() |
parseFloat() |
encodeURIComponent() |
parseInt() |
escape() |
String() |
eval() |
unescape() |
isFinite() |
|
Created By
https://aloneonahill.com
Metadata
Favourited By
and 190 more ...
Comments
Piotrek 20:16 28 Feb 12
Where's typof() ?
pdf isjunk 15:22 6 Aug 12
When you hit the PDF button, it chops off the bottom of the page and has a second page with your face and half of the credits on it. comical fail. Thought you should know.
Murali Prashanth N 08:42 16 Feb 13
Thnx...dave
?????????????? 08:43 16 Feb 13
Wheres alert() and prompt()?
Dave Lampton 17:16 26 Mar 13
The event handlers should be all lowercase.
santsoh suryawanshi 17:44 17 Feb 14
these PDF make easy to create web site ,present and validate as well.
there is no need to open any book or google for any tag.
Thnk you dave.
Er1c Nevertells 19:45 31 Oct 14
This is a messed up ripoff of other quality quick references, with your mug slapped in it and a shameless plug to your site.
DaveChild, 19:47 31 Oct 14
I published the first version of this cheat sheet on ILoveJackDaniels.com in 2005. I don't think there were many others around then, if any. It's been through a few changes in that time, of course, but it's basically the same.
James 17:35 19 Oct 15
Thanks Dave, with all the criticism and few thanks its a wonder people try to help each other. Good work.
pppandit 17:35 19 Oct 15
very good
Michael Pohoreski 16:09 16 Sep 16
Good starting point but still has a few errors (as of Jan 2016) :-/
1. Dates are not alphabetized. i.e. getYear, getSeconds, are out of order
2. Dates functions are missing parenthesis. i.e. getYear()
3. Missing Date.now()
elbeji, 15:43 7 Dec 20
thanks a lot
Add a Comment
Related Cheat Sheets
More Cheat Sheets by DaveChild