Created
July 22, 2011 16:13
-
-
Save dmethvin/1099753 to your computer and use it in GitHub Desktop.
Better Simpsons
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
function createSimpsons() { | |
var theSimpsons = ['Bart', 'Homer', 'Marge', 'Maggy', 'Lisa'], | |
numberOfSeasons = 21, | |
avgEpisodesPerSeason = 22; | |
$("#title").append("The Simpson Family"); | |
$("#details").append( | |
"<p>Number of seasons: " + numberOfSeasons + "</p>", | |
"<p>Episodes per season: " + avgEpisodesPerSeason + "</p>", | |
// most likely an incorrect count, since the average is unlikely to be a whole number? | |
"<p>Total number of episodes: " + (numberOfSeasons * avgEpisodesPerSeason) + "</p>" | |
); | |
$("#simpsons").append("<li>" + theSimpsons.join("</li><li>") + "</li>"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment