var officers = { captain: {name: "Jean-luc Picard", rank: "Captain", race: "Human"}, first_officer: {name: "William Riker", rank: "Commander", race: "Human"}, operations_officer: {name: "Data", rank: "Lt. Commander", race: "Soong android"}, medical_officer: {name: "Beverly Crusher", rank: "Commander", race: "Human"}, tactical_officer: {name: "Worf", rank: "Lietenant", race: "Klingon"}, chief_engineer: {name: "Geordi La Forge", rank: "Lt Commander", race: "Human"}, counselor: {name: "Deanna Troi", rank: "Commander", race: "Half-Betazed"} }; $.each(officers, function(position) { $("#log").append($("<ul>").text( this.name + " is a " + this.race + " who serves as " + position.replace(/_/, ' ') + " aboard the USS Enterprise NCC-1701-D." )); });