What's wrong in my JavaScript code?

Posted by DarkLightA on Stack Overflow See other posts from Stack Overflow or by DarkLightA
Published on 2010-12-30T19:38:41Z Indexed on 2010/12/30 19:54 UTC
Read the original article Hit count: 252

Filed under:
|

I can't figure out what's wrong.

var CarObj = function(passengers, maxLoad, wheels, doors, maxSpeed) {
    this.passengers = passengers;
    this.maxLoad = maxLoad;
    this.wheels = wheels;
    this.doors = doors;
    this.maxSpeed = maxSpeed;
};
var ferrari = new CarObj(4, "700kg", 4, 2, "360km/h");
var output = new Array();
for (var i = 0; i < ferrari.length; i++) {
    for (var a in ferrari) {
        output[i] = a;
    }
}
document.getElementById('ELEMENTHERE').innerHTML = (output.join(" "));

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about clientside