Created
March 9, 2015 15:59
-
-
Save misutowolf/8a3207b821b2b6818cd6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| for (var i = 1; i <= numRanks; i++) { | |
| var rankName = theRanks[i-1].name + "s"; | |
| theHTML += "<h5>" + rankName + "</h5>"; | |
| var theGroup = _.filter(theRoster, function(item) { return item.rank === i; }); | |
| console.log(JSON.stringify(theGroup)); | |
| // Check for empty rank (no members of rank) | |
| if (_.isEmpty(theGroup)) { | |
| theHTML += "<ul><li>None</li></ul>"; | |
| } else { | |
| theHTML += "<ul>"; | |
| for (obj in theGroup) { | |
| theHTML += "<li>" + obj.user + "</li>"; | |
| } | |
| theHTML += "</ul>"; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment