Display values from array : <p>When the user clicks a button I want the below data to be displayed on my webpage in the following format:</p>

<p>car1 - id:1346 - type BMW</p>

<p>car2 - id: 1379 - type Holden</p>

<p>etc...</p>

<p>How exactly would I go about doing this?
I tried this: </p>

<p><code>document.getElementById('message').innerHTML = car1</code></p>

<p>But all that was displayed was '[object Object]'</p>

<pre><code>    var car1 = {id:"1346", type:"BMW"};
    var car2 = {id:"1379", type:"Holden"};
    var car3 = {id:"2580", type:"Ford"};
    var cararray = [car1, car2, car3];
</code></pre>
