Test name | Executions per second |
---|---|
toLowerCase() | 6752295.5 Ops/sec |
Regex | 3341802.5 Ops/sec |
toLowerCase() FAIL | 6811401.0 Ops/sec |
Regex FAIL | 3397052.5 Ops/sec |
var a = "soFt"
var b = "Software Development"
var c = "doFt"
a.toLowerCase() === b.toLowerCase()
const re = new RegExp(a, "gi")
re.test(b)
c.toLowerCase() === b.toLowerCase()
const re = new RegExp(c, "gi")
re.test(b)