Script Preparation code:
AخA
 
var strIn = "abcdefghijklmnopqrstuvwxyz";
var strOut = '';
Tests:
  • Luke

     
    const capt = (str) => {
      let str_split = str.split("");
      str_split.forEach((str_sub, ind) => { str_split[ind] = ((ind === 0) ? str_sub.toUpperCase() : str_sub)});
      return str_split.join("");
     };
    strOut = capt(strIn);
  • Slice

     
    const captSlice = (str) => str.charAt(0).toUpperCase() + str.slice(1);
    strOut = captSlice(strIn);
  • Danny

     
    const captReg = (str) => str.replace(/^(\w)/, $1 => $1.toUpperCase())
    strOut = captReg(strIn)
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Luke
    Slice
    Danny

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36
Chrome 85 on Mac OS X 10.15.6
View result in a separate tab
Test name Executions per second
Luke 910234.6 Ops/sec
Slice 3411640.0 Ops/sec
Danny 533824.6 Ops/sec