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
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter