String Methods Flashcards

1
Q

Returns the character at a specified index (position)

A

charAt()

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

Returns the Unicode of the character at a specified index

A

charCodeAt()

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

Returns two or more joined strings

A

concat()

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

Returns the string’s constructor function

A

constructor

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

Returns if a string ends with a specified value

A

endsWith()

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

Returns Unicode values as characters

A

fromCharCode()

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

Returns if a string contains a specified value

A

includes()

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

Returns the index (position) of the first occurrence of a value in a string

A

indexOf()

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

Returns the index (position) of the last occurrence of a value in a string

A

lastIndexOf()

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

Returns the length of a string

A

length

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

Compares two strings in the current locale

A

localeCompare()

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

Searches a string for a value, or a regular expression, and returns the matches

A

match()

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

Allows you to add properties and methods to an object

A

prototype

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

Returns a new string with a number of copies of a string

A

repeat()

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

Searches a string for a value, or a regular expression, and returns a string where the values are replaced

A

replace()

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

Searches a string for a value, or regular expression, and returns the index (position) of the match

A

search()

17
Q

Extracts a part of a string and returns a new string

A

slice()

18
Q

Splits a string into an array of substrings

A

split()

19
Q

Checks whether a string begins with specified characters

A

startsWith()

20
Q

Extracts a number of characters from a string, from a start index (position)

A

substr()

21
Q

Extracts characters from a string, between two specified indices (positions)

A

substring()

22
Q

Returns a string converted to lowercase letters, using the host’s locale

A

toLocaleLowerCase()

23
Q

Returns a string converted to uppercase letters, using the host’s locale

A

toLocaleUpperCase()

24
Q

Returns a string converted to lowercase letters

A

toLowerCase()

25
Q

Returns a string or a string object as a string

A

toString()

26
Q

Returns a string converted to uppercase letters

A

toUpperCase()

27
Q

Returns a string with removed whitespaces

A

trim()

28
Q

Returns the primitive value of a string or a string object

A

valueOf()