JSFiddle - React, Tailwind, and code Playground
JavaScript
var winloc = 'http://mysite.com/home.html'; //for e.g http://mysite.com/home.html
var ishtml = /html$/i.test(winloc); //Remove the i if you want to match only html and not HTML
if(ishtml === true){
document.write('Ends in .html');
}