JavaScript String startsWith() method
determines if a string starts with a specified string

startsWith() method determines whether this string begins with the characters of a specified string.

syntax

startsWith(searchString, start)

searchString The characters to be searched for at the start of this string. Cannot be a regex.

All values that are not regexes are coerced to strings.

start (optional). The start position at which searchString is expected to be found (the index of searchString's first character).

startsWith() method returns true if a string starts with a specified string.

startsWith() method returns false if a string does NOT start with a specified string.

startsWith() method is case sensitive.

If searchString is a regex TypeError is thrown.

You can use a start position where the searchString is expected to start from. Default start position is 0.

syntax 1 description
determine whether myString starts with specified string
myString.startsWith(searchString)
syntax 2 description
determine whether myString starts at start position with a specified string
myString.startsWith(searchString, start)