JavaScript Cheat Sheet by DaveChild
1 Comment
|
Add a Comment
|
PDF Download
|
Find:
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 |
There's an excellent regular expression tester at: http://regexpal.com/
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 |
* PCRE modifier
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() |
|
Favourited by 18 Members:
Comments
Where's typof() ?
Add a Comment
You are posting a reply. Cancel Reply.
Contents
JavaScript methods and functions, a guide to regular expressions and the XMLHttpRequest object.
Cheatographer
www.addedbytes.com
More by DaveChild
Cheat Sheet Stats
Tags
Related (shares tags with):
Thumbnail