1. Home
  2. Javascript
  3. 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