Array vs TypedArray

Edit on GitHub

Setup

Tests

  • Array

    var a = [];
    for(let i=0;i<1000;i++){
       a[i] = i;
    }
  • TypedArray

    var a = new Uint16Array(1000);
    for(let i=0;i<1000;i++){
       a[i] = i;
    }