Courses / JavaScript
72. String.prototype.startsWith()
Determines whether a string begins with the characters of a specified string.
1 min read Chapter 72 of 99
JavaScript
String.prototype.startsWith()
It checks if a string starts with a specified substring.
"I want to ensure my input starts with the right prefix."
`startsWith()` is a method that determines if a string begins with the characters of a specified string, returning `true` or `false`.
"I want to ensure my input starts with the right prefix."
`startsWith()` is a method that determines if a string begins with the characters of a specified string, returning `true` or `false`.