Skip to content

Commit

Permalink
ES6 Classes example.
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanerck committed Oct 7, 2017
1 parent 56c4db6 commit c747cfb
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
27 changes: 27 additions & 0 deletions ES6Classes/index.html
@@ -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>
3 changes: 2 additions & 1 deletion SlideDeck/index.html
Expand Up @@ -242,8 +242,9 @@ <h2>Other Resources</h2>
<li>CanIUse.com</li>
<li>The Mega HTML5 Cheatsheet
<br />
https://medium.com/level-up-web/the-mega-html5-cheatsheet-e8c479b1c521
medium.com/level-up-web/the-mega-html5-cheatsheet-e8c479b1c521
</li>
<li>developer.mozilla.org</li>
</ul>
</section>

Expand Down

0 comments on commit c747cfb

Please sign in to comment.