categories is an array, not all browsers (e.g. IE) support Array.prototype.forEach.