---
# System prepended metadata

title: new Array() in Array and Object

---

# new Array() in Array and Object

```javascript=
// Array

var namesArray = []; // implicitly

var usersArray = new Array();  // explicitly
 
// Object
var namesObject = {}; // implicitly

var usersObject = new Object();  // explicitly


// implicitly is faster then explicitly
// implicitly simple define | explicitly proper manner define

// test 
console.time('implicitlyArray');
for (var i = 0; i < 1e7; ++i) {
    var a = [];
}; 
console.timeEnd('implicitlyArray');

console.time('explicitlyArray');
for (var i = 0; i < 1e7; ++i) {
    var a = new Array();
}; 
console.timeEnd('explicitlyArray');

// implicitlyArray: 109.287109375ms
// explicitlyArray: 174.904052734375ms

console.time('implicitlyObject');
for (var i = 0; i < 1e7; ++i) {
    var a = {};
}; 
console.timeEnd('implicitlyObject');

console.time('explicitlyObject');
for (var i = 0; i < 1e7; ++i) {
    var a = new Object();
}; 
console.timeEnd('explicitlyObject');

// implicitlyObject: 132.744140625ms
// explicitlyObject: 137.87109375ms
```