JavaScript String Methods Flashcards

1
Q

length

A

shows the size

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

.concat()

A

merges two string and creates one

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

.padStart(targetLength, padString)/padEnd(targetLength, padString)

A

adds elements to the start or to the end

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

.at(index)

A

takes an integer value and returns a new String consisting of the single UTF-16 code unit located at the specified offset.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

startsWith(searchString, endPosition)/endsWith(searchString, endPosition)

A

determines whether a string starts or ends with the characters of this string, returns true or false as appropriate.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

.includes( searchString, position)

A

performs a case-sensitve search to determines whether a given string may be found within this string, returning true or false as appropriate.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

indexOf(searchString, position)

A

Searches this string and returns the index of the first occurrence of the specified substring.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

.match( regexp )

A

finds the matching string against a regular expression.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

.repeat( count )

A

Returns a new string which contains the specified number of copies of this string, concatenated together.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

replace(pattern, replacement)

A

Returns a new string with one, some, or all matches of a pattern replaced by a replacement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

replaceAll(pattern, replacement)

A

Returns a new string with all matches of a pattern replaced by a replacement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

search(regexp)

A

Executes a search for a match between a regular expression and this string, returning the index of the first match in the string.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

slice(start, end)

A

Extracts a section of this string and returns it as a new string, without modifying the original string.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

.split(separator, limit)

A

Divides this string into an ordered list of substrings by searching for the pattern, puts these substrings into an array, and returns the array.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

trim()

A

Removes whitespace from both ends of this string and returns a new string, without modifying the original string.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly