JavaScript Assignment

profilejpFlute
last_weeks_notes_from_instructor.docx

Grade 70 out of 100

There is really no such thing as a datatype in javascript:

i.e. String / Integer, etc.

var Make : String;

var Model : String;

var Year : Integer;

var Color : String;

var FullName : String;

We just declare variables as typeless

var Make;

var Model;

But also, “Classes” are implemented via functions - there is no Class keyword

See example below

function Vehicle(make, model, year, color)

{

this.make = make;

this.model = model;

this.year = year;

this.color=color;

alert(this.make + this.model + this.year + this.color );

}

Then you could add something like this to your button clicks

<button onclick="Vehicle('Toyota', 'Camry', '1990','red')">Information</button>

Grade 70 out of

100

There is really no such thing as a datatype in javascript:

i.e. String / Integer, etc.

var Make : String;

var Model : String;

var Year : Integer;

var Color : String;

var FullName : String;

We just declare variables as typeless

var Make;

var Model;

But also, “Classes” are implemented via functions

-

there is no Class keyword

See example below

function Vehicle(make, model, year, color)

{

this.make = make;

this.model = model;

this.year = year;

this.color=color;

alert(this.make + this.model + this.year

+ this.color );

}

Then you could add something like this to your button clicks

<button onclick="Vehicle('Toyota', 'Camry', '1990','red')">Information</button>

Grade 70 out of 100

There is really no such thing as a datatype in javascript:

i.e. String / Integer, etc.

var Make : String;

var Model : String;

var Year : Integer;

var Color : String;

var FullName : String;

We just declare variables as typeless

var Make;

var Model;

But also, “Classes” are implemented via functions - there is no Class keyword

See example below

function Vehicle(make, model, year, color)

{

this.make = make;

this.model = model;

this.year = year;

this.color=color;

alert(this.make + this.model + this.year + this.color );

}

Then you could add something like this to your button clicks

<button onclick="Vehicle('Toyota', 'Camry', '1990','red')">Information</button>