0% found this document useful (0 votes)
6 views2 pages

JavaScript Methods Cheat Sheet 2022

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

JavaScript Methods Cheat Sheet 2022

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Javascript String, Array and Object Methods 2022 Cheat Sheet

by flight via [Link]/169565/cs/35513/

String Methods String Methods (cont)

[Link](index) Return character in string str at [Link]​leL​owe​r[U​ppe​‐ Convert chars in string str to lower /
specified index r]Case() upper case while respecting current
[Link][Upper]Case() Convert string str to lower / upper case locale

str.[last]indexOf(substr) Return first / last index within string str [Link][Right]() Trim whitespace from left / right side of
of substring substr string st

[Link] (separator) Split string str into an array of substrings [Link](str2) Return -1, 0, or 1 indicating if string str1
separated by param separator is less than, equal to, or greater than str2

[Link]() Trim whitespace from beginning and [Link](regexp) Match a regular expression regexp
end of string str against string str

[Link](index) Return non-ne​gative int from string str [Link](regexp, Replace matched regexp elements in
that is the UTF-16 encoded code point str2) string str1 with string str2
at given index [Link](regexp) Return position of search for a match

[Link](str2) Return true if str2 is found in string str1 between regexp and string str

[Link][ends]With(str2) Return true if string str1 starts / ends {{noshy}[Link] Return length of string str
with string str2
Object methods
[Link] () Return Unicode Normal​ization Form of
string str [Link](target, copies properties from one or more
...sources) source objects to target object
[Link](int) Return string repeated int times of string
str [Link] (proto, creates new object, using an
[propertiesObject]) existing object as the prototype
str[@@iterator] () Return a new Iterator that iterates over
the code points of string str, returning [Link][ies] (obj, defines new or modifies existing
each code point as String value prop, descriptor) property

[Link](index) Return number indicating Unicode value [Link](obj) returns array of object's [key, value]
of char at given index of string str pairs

[Link](str2) Combine text of strings str1 and str2 and [Link] (obj) freezes an object, which then can
return a new string no longer be changed

[Link](start, end) Extract a section of string str from start [Link]() transforms a list of key-value pairs
to end into an object

[Link](start, length) Return characters in string str from start [Link]​Pro​per​tyD​esc​‐ returns a property descriptor / all
having length length rip​tor[s] (obj, prop) own property descri​ptors for an own
property
[Link] (index1, Return subset of string str between
index2) index1 and index2 [Link]​Pro​per​‐ returns array of all properties
tyNames(obj)
[Link]​Pro​per​tyS​‐ array of all symbol properties
ymbols(obj)
[Link](obj) returns the prototype
[Link](value1, value2) determines whether two values are
the same value

By flight Published 17th November, 2022. Sponsored by [Link]


[Link]/flight/ Last updated 17th November, 2022. Learn to solve cryptic crosswords!
Page 1 of 2. [Link]
Javascript String, Array and Object Methods 2022 Cheat Sheet
by flight via [Link]/169565/cs/35513/

Object methods (cont) Array methods (cont)

[Link] (obj) determines wether an object can have [Link](fn) Return true if at least one element in array a1
new properties added to it satisfies provided testing function fn
[Link](obj) determines if an object is frozen / [Link](fn) Create a new array with all elements of array
[Link](obj) sealed a1 which pass the filtering function fn
[Link] (obj) returns array of object's enumerable [Link](fn) Create a new array with results of calling
property names function fn on every element in array a1
[Link]​tEx​ten​‐ prevents new properties from being [Link][Right](fn) Apply a function fn against an accumu​lator
sions (obj) added to an object and each value (from left to right / right to left)
[Link](prop) returns boolean indicating whether of the array as to reduce it to a single value
object has the specified property [Link]() Remove and return last element from array a1

protot​[Link]​‐ checks if object exists in another [Link](obj) Add obj to end of array a1 and return new
otypeOf(object) object's prototype chain length
[Link]​tyI​sEn​ume​‐ checks whether the specified property [Link] () Reverse order of elements of array a1 in
rable(prop) is enumerable and is the object's own place
property [Link]() Sort the elements of array a1 in place
[Link]() returns a string repres​enting the object [Link](start, Change content of array a1 by removing
[Link](obj) prevents new properties from being deleteCount, items) existing elements and/or adding new
added and marks all existing properties elements
as non-co​nfi​gurable [Link](obj) Add obj to start of array a1 and return new
[Link](obj) returns array of object's own length
enumerable property values [Link]() Return a string repres​enting array a1 and its
elements (same as a1. join(','))
Array methods
[Link]​leS​tring() Return a localized string repres​enting array a1
[Link](a2) Return new array by joining arrays a1 and a2 and its elements (similar to [Link]​n(','))
together
[Link](var) Return true if var is an array [Link]
[Link](separator) Join all elements of array a1 into a string
[Link] Return length of a1
separated by separator arg
[Link](start, end) Extract a section from start to end of array a1
and return a new array
a1.[last]indexOf(obj) Return first / last index of obj within array a1
[Link](fn) Calls function fn for each element in the array
a1
[Link](fn) Return true if every element in array a1
satisfies provided testing function fn

By flight Published 17th November, 2022. Sponsored by [Link]


[Link]/flight/ Last updated 17th November, 2022. Learn to solve cryptic crosswords!
Page 2 of 2. [Link]

You might also like