JSFiddle - React, Tailwind, and code Playground
JavaScript
var myHilitor = new Hilitor();
myHilitor.setMatchType("exact");
myHilitor.apply();
var myHilitor2 = new Hilitor();
myHilitor2.setMatchType("exact-wrong");
myHilitor2.apply();
function Hilitor()
{
var excat;
this.setMatchType = function(type)
{
if(type == "exact"){excat = true;}
};
this.setRegex = function(input)
{
alert(excat);
};
this.apply = function(input)
{
this.setRegex();
};
}