arr vs obj

Edit on GitHub

Setup

Tests

  • arr

    var x = [];
    x[30000]= Math.random()
    x[40000] = x[30000]*Math.random()
    console.log(x[40000], x.length)
  • obj

    var x = {};
    x[30000]= Math.random()
    x[40000] = x[30000]*Math.random()
    console.log(x[40000], x.length)