String Methods Flashcards
(19 cards)
at()
What does the above do in Javascript?
returns an indexed character from a string
charAt()
What does the above do in Javascript?
returns the character at a specified index (position)
charCodeAt()
What does the above do in Javascript?
returns the Unicode of the character at a specified index (position)
codePointAt()
What does the above do in Javascript?
returns the unicode value at an index (position) in a string
concat()
What does the above do in Javascript?
returns two or more joined strings
constructor
What does the above do in Javascript?
returns the string’s contructor function
endsWith()
What does the above do in Javascript?
returns if a string ends with a specified value
fromCharCode()
What does the above do in Javascript?
returns unicode values as characters
includes()
What does the above do in Javascript?
returns if a string contains a specified value
indexOf()
What does the above do in Javascript?
returns the index (position) of the first occurence of a value in a string
lastIndexOf()
What does the above do in Javascript?
returns the index (position) of the last occurence of a value in a string
length
What does the above do in Javascript?
returns the length of a string
localeCompare()
What does the above do in Javascript?
compares two strings in the current locale
match()
What does the above do in Javascript?
searches a string for a value, or a regular expression, and returns the matches
padEnd()
What does the above do in Javascript?
pads a string at the end
padStart()
What does the above do in Javascript?
pads a string from the start
prototype
What does the above do in Javascript?
allows you to add properties and methods to an object
repeat()
What does the above do in Javascript?
returns a new string with a number of copies of a string
replace()
What does the above do in Javascript?
searches a string for a pattern, and returns a string where the first match is replaced