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

PHOTO EMBED

Fri Sep 16 2022 09:20:01 GMT+0000 (Coordinated Universal Time)

Saved by @sreejithbs

let string = 'Love is the most powerful feeling in the world'

console.log(string.endsWith('world'))         // true
console.log(string.endsWith('love'))          // false
console.log(string.endsWith('in the world')) // true

let country = 'Finland'

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

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