myFavoriteBands -- Now with Tags


posted May 21, 2015

myFavoriteBands now has tags. You can tag a band, and above the list of bands you can click on a tag to only view bands with that tag.

Javascript Notes

Adding the "tag cloud" was difficult. I first searched through every object in the bands array and added any tags to a new array, which had several duplicates. After spending a long time trying to compare an element in the new array with every other element to find a matching tag (and failing miserably) I finally fell upon a simply solution on Stack Overflow: simply put all the tags in an object, then run a for…in loop and add keys to a new array (which removes all the duplicates).