Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36 Edg/83.0.478.45
Chrome 83
Windows
Desktop
4 years ago
Test name Executions per second
outside 78715120.0 Ops/sec
inside 79016392.0 Ops/sec
Tests:
  • outside

    AخA
     
    const condition = true;
    let counter = 0;
    if (condition)
    for (let i = 0; i < 10; i++) counter += i;
    else
    for (let i = 0; i < 10; i++) counter += counter;
  • inside

     
    const condition = true;
    let counter = 0;
    for (let i = 0; i < 10; i++) counter += condition ? i : counter;