Сейчас я прохожу ООП JavaScript'a. Но почему-то не работают конструкторы. Причина мне, как новичку, непонятна. В чем проблема? Вот код:
<script type='text/javascript'>
function Automobile(color, model, year, manufact)
{
this.color = color + " " || "white";
this.model = model + " "|| "A1";
this.year = year + " " || "2000";
this.manufact = manufact + " " || "Toyota";
function autoInfo ()
{document.write(this.manufact + this.model + this.year);}
function autoColor()
{document.write(color);}
}
function driver (color, model, year, manufact, name, experiance)
{
this.base = Automobile;
this.base(color, model, year, manufact);
this.name = name + " " || "Vasiliy";
this.experiance = experiance + " " || 1;
function driverinfo()
{document.write(this.name + ": experiance " + this.xperiance + "year");}
}
vlad = new driver ("Red", "Skylane", "Nissan", "Vladislav", 5);
vlad.autoInfo();
vlad.autoColor();
document.write("<br/>");
vlad.driverinfo();
</script>