Objects
HTML
<input id="Test" type="text"></input>
JavaScript
var car = function (year, color, make) {
this.year = year || 2015;
this.color = color || 'white';
this.make = make || 'BMW';
};
var cars = [];
//Objects
var defaultCar = new car();
cars.push(defaultCar);
cars.push(new car('2015','red','MB'));
console.dir(cars);
document.getElementById('Test').value = JSON.stringify(cars);