Tests:
  • Split String

    AخA
     
    'Mary has a little lamb'.split(' ').map(w => `${w.charAt(0).toUpperCase()}${w.slice(1)}`).join(' ')
  • Regex

     
    'Mary has a little lamb'.replace(/^(.)|\s+(.)/g, c => c.toUpperCase())
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Split String
    Regex

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 years ago)
Mozilla/5.0 (X11; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0
Firefox 75 on Linux
View result in a separate tab
Test name Executions per second
Split String 1967893.8 Ops/sec
Regex 1719464.4 Ops/sec