EN
JavaScript - check if string starts with
0 points
In this article, we would like to show you how to check if string starts with a specific word in JavaScript.
Quick solution:
xxxxxxxxxx
1
const text = 'Example text...';
2
3
const result = text.startsWith('Example');
4
5
console.log(result); // true