Script Preparation code:
AخA
 
var strIn = "monkeybananaparrotmonkeybananaparrotmonkeybananaparrotmonkeybananaparrot";
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 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36
Chrome 85 on Linux
View result in a separate tab
Test name Executions per second
Luke 586043.9 Ops/sec
Slice 3972389.5 Ops/sec
Danny 1292347.2 Ops/sec