so here is the code
var searchValue = "Dans-Test";
if ( searchValue.indexOf('-') >= 0 ){
searchValue.replace('-', ' ');
console.log("reached here");
} else {
console.log("no -");
}
console.log(searchValue);
searchValue is still outputting Dan-Test and not Dan Test, why?
it does console log reached here so the if statement is correct
thanks