JSFiddle - React, Tailwind, and code Playground

JavaScript

var str = 'hello!';
var result = str.startsWith('he');

// prints "true"
console.log(result);

// verify starting from the third character
result = str.startsWith('ll', 2);

// prints "true"
console.log(result);