Skip to content

Conversation

@jurlem
Copy link

@jurlem jurlem commented Feb 17, 2019

No description provided.

Copy link

@lienekechee lienekechee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice merle, everything looks neat! let's try to find a way next time we do something similar to reduce duplicate code, and change classes in the starter code if you need to :)

sum -=1;
}
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it might be useful here to create two functions that could help you avoid duplicate code:
e.g. calculatePrice() and toggleIngredient() for example. A function like setupDefaultToppings() might also be handy in terms of readability. Then the challenge is, how can you define and organize your classes to be able to do these things for every ingredient with one function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants