Script Preparation code:
x
 
string1 = "something is not right but we can make it longer < and > also more stuff < try to make it <br>"
Tests:
  • Includes

     
    if (!string1.includes("<br>") && !string1.includes("/>")) {
        console.log("something else");
    }
  • Match

     
    if (!string1.match(/(\/>|<br>)/)){
        console.log("something else");
    }
  • IndexOf

     
    if (string1.indexOf("<br>") === -1 && string1.indexOf("/>") === -1) {
        console.log("something else");
    }
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Includes
    Match
    IndexOf

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36
Chrome 75 on Windows
View result in a separate tab
Test name Executions per second
Includes 5037679.0 Ops/sec
Match 3604696.8 Ops/sec
IndexOf 5219480.5 Ops/sec