export class Allergies {
constructor(score) {
this.score = score;
this.list_items = ['eggs', 'peanuts', 'shellfish', 'strawberries', 'tomatoes', 'chocolate', 'pollen', 'cats'];
}
list() {
return this.list_items.filter((item, i) => (this.score >> i) & 1);
}
allergicTo(item) {
return this.list().includes(item);
}
}