Code to go logo
Created using Figma
Use Cases
Contribute
How to check if string starts with substring in JavaScript
Strings
By Jad Joubran ·
Last updated Feb 01, 2018
const string = "js is awesome"; string.startsWith("js");
true
Feb 01, 2018
1
Jad Joubran
See answer
1
Jad Joubran
String.startsWith
on MDN
Learn JavaScript step by step
Related use cases
How to check if string ends with substring in JavaScript