Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Firefox/60.0
Firefox 60
Mac OS X 10.14
Desktop
4 years ago
Test name Executions per second
a32 102.1 Ops/sec
34234 102.3 Ops/sec
Tests:
  • a32

    x
     
    let a = [];
    const n1 = 1;
    const s1 = '1';
    for (let i = 0; i < 100000; i++) {
        a.push(n1);
        a.push(s1);
    }
    for (const c of a) {
        const d = typeof c === 'number' ? c : Number(c);
    }
  • 34234

     
    let a2 = [];
    const n12 = 1;
    const s12 = '1';
    for (let i = 0; i < 100000; i++) {
        a2.push(n12);
        a2.push(s12);
    }
    for (const c of a2) {
        const d = Number(c);
    }