1. Home
  2. Javascript
  3. String starts with
#javascript#string#es6

Check if the string starts with the given text.

let title = 'Section introduction';
title.startsWith('Section') // Returns true
title.startsWith('sec') // Returns false
title.startsWith('intro') // Returns false
copy
Full Javascript cheatsheet
Sitemap Git repository