So let's say that I have this:
function Car(make, model, year) {
  this.make = make;
  this.model = model;
  this.year = year;
}
var car1 = new Car("VW", "Bug", 2012);
var car2 = new Car("Toyota", "Prius", 2004);
document.write(car1.make, car1.model, car1.year);
document.write(car2.make, car2.mocel, car2.year);
Is there a cleaner way to write out all of the properties/values of objects? Thank!
You can use JSON.stringify to serialize an object and easily log its properties:
console.log(JSON.stringify(car1))
To enumerate all the properties of an object in JavaScript:
for (aProperty in yourObject) {
    // do what needed
    // in case you want just to print it:
    console.log(aProperty + "has value: " + yourObject[aProperty]);
}
However, if you just meant to print the object to the console, maybe this question can help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With