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]leLower[Uppe‐ 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-negative 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 Normalization 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]PropertyDesc‐ returns a property descriptor / all
having length length riptor[s] (obj, prop) own property descriptors for an own
property
[Link] (index1, Return subset of string str between
index2) index1 and index2 [Link]Proper‐ returns array of all properties
tyNames(obj)
[Link]PropertyS‐ 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]tExten‐ prevents new properties from being [Link][Right](fn) Apply a function fn against an accumulator
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]tyIsEnume‐ 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 representing 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-configurable [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 representing array a1 and its
elements (same as a1. join(','))
Array methods
[Link]leString() Return a localized string representing 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]