function showStatistics(args) {
document.write("<p><strong>Name:</strong> " + args.name + "<br />");
document.write("<strong>Team:</strong> " + args.team + "<br />");
if (typeof args.position === "string") {
document.write("<strong>Position:</strong> " + args.position + "<br />");
}
if (typeof args.average === "number") {
document.write("<strong>Average:</strong> " + args.average + "<br />");
}
if (typeof args.homeruns === "number") {
document.write("<strong>Home Runs:</strong> " + args.homeruns + "<br />");
}
if (typeof args.rbi === "number") {
document.write("<strong>Runs Batted In:</strong> " + args.rbi + "</p>");
}
}
showStatistics({
name: "Mark Teixeira"
});
showStatistics({
name: "Mark Teixeira",
team: "New York Yankees"
});
showStatistics({
name: "Mark Teixeira",
team: "New York Yankees",
position: "1st Base",
average: .284,
homeruns: 32,
rbi: 101
});
Group items matching
in title, tags, annotations or url
1More
Bookmarklets, Favelets and Snippets | Smashing Magazine - 0 views
1More
JS Bin - Collaborative JavaScript Debugging - 1 views
8 Useful jQuery Snippets For URL's & Querystrings « Design Chemical - jQuery,... - 0 views
f66 ReSize TextBox and TextArea - 0 views
Javascript Serialize Function - 0 views
1 - 11 of 11
Showing 20▼ items per page