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

Anas 95 - Javascript Object Methods

The document provides a cheat sheet of common JavaScript object methods for strings, numbers, dates, math, and arrays. It lists the method name, description, and examples for each object type.

Uploaded by

lekha.cce
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Anas 95 - Javascript Object Methods

The document provides a cheat sheet of common JavaScript object methods for strings, numbers, dates, math, and arrays. It lists the method name, description, and examples for each object type.

Uploaded by

lekha.cce
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

JavaScript Object Methods Cheat Sheet

by anas_95 via cheatography.com/27935/cs/8209/

String Object Methods Math Object Methods Array Object Methods (cont)

Method Descri​ption Method Descri​ption indexOf() search the array for an element
charAt() returns the character at the abs(x) returns the absolute value of x and returns its position
specified index round(x) rounds x to the nearest integer join() joins all elements of an array

concat() joins two or more strings, and into a string


ceil(x) returns x, upwards to the
returns a copy of the joined nearest integer lastIn​‐ search the array for an element,
strings dexOf() starting at the end, and returns
floor(x) returns x, rounded downwards
indexOf() returns the position of the first its position
to the nearest integer
found occurence of a specified pop() removes the last element of an
exp(x) returns the value of Ex
value in a string array, and returns that element
log(x) returns the narural logarithm
lastIn​‐ returns the position of the last push() adds new elements to the end
(base E) of x
dexOf() found occurence of a specified of an array, and returns the new
max(x, y, returns the number with the
value in a string length
z, ...) highest value
replace() searches for a match between reverse() reverses the order of the
min(x, y, returns the number with the
a substring (or regex) and a elements in an array
z, ...) lowest value
string, and replaces the shift() removes the first element of an
matched substring with a new pow(x, y) returns the value of x to the
array, and returns that element
substring power of y (xy )
sort() sorts the elements of an array
search() searches for a match between sqrt(x) returns the square root of x
toString() converts an array to a string,
a regex and a string, and random() returns a random number
and returns the result
returns the position of the match between 0 and 1
valueOf() returns the primitive value of an
slice() extracts a part of a string and sin(x) returns the sine of x (x in
array
returns a new string radians)
split() splits a string into an array of cos(x) returns the cosine of x (x in Number Object Methods
substrings radians)
Method Descri​ption
substr() extracts the characters from a tan(x) returns the tangent of an x
toExpo​‐ converts a number into an
string, beginning at a specified
nen​tial(x) expone​ntial notation
start position, and through the Date Object Methods
specified number of character toFixed(x) formats a number with x
Method Meaning Units
numbers of digits after the
substr​‐ extracts the characters from a
getFul​‐ 4-digit year 2000, 2001, decimal point
ing() string, between two specified
lYear() ...
indices toPrec​isi​‐ formats a number to x length
getMonth() month no. 0 - 11 on(x)
toLowe​‐ converts a string to lowercase
getDate() dat of 0 - 31 toString() converts a Number object to a
rCase() letters
month string
toUppe​‐ converts a string to uppercase
getHours() hour no. 0 - 23 valueOf() returns the primitive value of a
rCase() letters
getMin​utes() minute no. 0 - 59 Number object
trim() removes whitespace from both
ends of a string getSec​‐ second no. 0 - 59
onds()
valueOf() returns the primitive value of a
String object
Array Object Methods
toString() returns the value of a String
object Method Descri​ption
concat() joins two or more arrays, and
returns a copy of the joined array

By anas_95 Published 15th May, 2016. Sponsored by Readable.com


cheatography.com/anas-95/ Last updated 15th May, 2016. Measure your website readability!
Page 1 of 1. https://readable.com

You might also like