Standard Syntax vs new Array() Syntax

Edit on GitHub

Array assignment using standard vs new Array syntax

Setup

var len = 10000000;

Tests

  • Standard Syntax

    let a = [];
    	for (let i = 0; i < len; i++) {
    		a[i] = 'a';
    	}
  • new Array() Syntax

    let a = new Array(len);
    	for (let i = 0; i < len; i++) {
    		a[i] = 'a';
    	}