What does `String.prototype.startsWith()` return?

JavaScript Developer Easy

JavaScript Developer — Easy

What does `String.prototype.startsWith()` return?

Key points

  • The method returns a boolean, not an index or a new string.
  • It specifically checks the beginning of the string.
  • This is useful for conditional logic based on the starting characters.

Ready to go further?

Related questions