0% found this document useful (0 votes)
28 views

Javascript Cheat Sheet: by Via

This document provides a cheat sheet on JavaScript syntax including regular expressions, arrays, numbers, event handlers, booleans, strings, dates, and functions. It lists common methods and properties for each topic in a condensed reference format.

Uploaded by

Jhol Anthony
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Javascript Cheat Sheet: by Via

This document provides a cheat sheet on JavaScript syntax including regular expressions, arrays, numbers, event handlers, booleans, strings, dates, and functions. It lists common methods and properties for each topic in a condensed reference format.

Uploaded by

Jhol Anthony
Copyright
© © All Rights Reserved
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 Expressions Syntax

Pattern Modifiers (cont)

JavaScript Arrays

x*

Allow comments and whitespace in

concat()

slice()

pattern

join()

sort()

Any single character

e*

Evaluate replacement

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

[^abc]

Not in range

shift()

valueOf()

$
.

Start of string
End of string

\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

JavaScript RegExp Object


compile()

lastParen

exec()

leftCOntext

JavaScript Numbers and Maths

global

multiline

abs()

min()

ignoreCase

rightContext

acos()

NEGATIVE_INFINITY

input

source

asin()

PI

lastIndex

test()

atan()

POSITIVE_INFINITY

atan2()

pow()

ceil()

random()

cos()

round()

sin()

exp()

sqrt()

floor()

SQRT1_2

LN10

SQRT2

LN2

tan()

log()

toSource()

LOG10E

toExponential()

LOG2E

toFixed()

max()

toPrecision()

MAX_VALUE

toString()

MIN_VALUE

valueOf()

lastMatch
JavaScript Event Handlers
onAbort

onMouseDown

onBlur

onMouseMove

onChange

onMouseOut

onClick

onMouseOver

onDblClick

onMouseUp

onDragDrop

onMove

onError

onReset

onFocus

onResize

onKeyDown

onSelect

Pattern Modifiers

onKeyPress

onSubmit

Global match

onKeyUp

onUnload

i*

Case-insensitive

onLoad

m*

Multiple lines

s*

Treat string as single line

There's an excellent regular expression tester


at: http://regexpal.com/

NaN

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

JavaScript Strings
valueOf()

toString()
JavaScript Dates

charAt()

slice()

charCodeAt()

split() x

concat()

substr()

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

getSeconds

setUTCDay()

getMilliseconds

setUTCMonth()

getTime

setUTCFullYear()

JavaScript Functions

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

String object methods with an x support regular


expressions.

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