difference between these 2 ways of creating a class in javascript
<p>what are the difference between these two ways of creating a class:</p>

<pre><code>var apple = {
    type: "macintosh",
    color: "red",
    getInfo: function () {
        return this.color + ' ' + this.type + ' apple';
    }
}

function Apple (type) {
    this.type = type;
    this.color = "red";
    this.getInfo = function() {
        return this.color + ' ' + this.type + ' apple';
    };
}
</code></pre>

<p>and how do you instantiate and use the members?</p>
