1. Home
  2. ›
  3. Javascript
  4. ›
  5. String starts with

Check if the string starts with the given text.

#javascript#string#es6
let title = 'Section introduction';
title.startsWith('Section') // Returns true
title.startsWith('sec') // Returns false
title.startsWith('intro') // Returns false
copy
Full Javascript cheatsheet