Last Updated: February 25, 2016
·
545
· jeroen_ransijn

Use array and object literals in JavaScript

Avoid using array and object constructors using new, instead go for the array or object literal.

// Avoid
var arr = new Array();
var obj = new Object();

// Use
var arr = [];
var obj = {};