Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<script> | ||
class Musician | ||
{ | ||
constructor( name, instrument ) | ||
{ | ||
this.name = name; | ||
this.instrument = instrument; | ||
} | ||
|
||
displayInfo() | ||
{ | ||
document.write( "Name: " + this.name + "<br />" ); | ||
document.write( "Instrument: " + this.instrument + "<br />" ); | ||
} | ||
}; | ||
|
||
var m1 = new Musician( "Mick Ronson", "guitar" ); | ||
var m2 = new Musician( "Tony Visconti", "bass" ); | ||
var m3 = new Musician( "Woody Woodmansey", "drums" ); | ||
var m4 = new Musician( "David Bowie", "vocals" ); | ||
|
||
m1.displayInfo(); | ||
m2.displayInfo(); | ||
m3.displayInfo(); | ||
m4.displayInfo(); | ||
|
||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters