startsWith: it takes a substring as an argument and it checks if the string starts with that specified substring. It returns a boolean(true or false).

PHOTO EMBED

Fri Sep 16 2022 09:19:53 GMT+0000 (Coordinated Universal Time)

Saved by @sreejithbs

let string = 'Love is the best to in this world'

console.log(string.startsWith('Love'))   // true
console.log(string.startsWith('love'))   // false
console.log(string.startsWith('world'))  // false

let country = 'Finland'

console.log(country.startsWith('Fin'))   // true
console.log(country.startsWith('fin'))   // false
console.log(country.startsWith('land'))  //  false
content_copyCOPY

https://github.com/Asabeneh/30-Days-Of-JavaScript/blob/master/02_Day_Data_types/02_day_data_types.md