CodeSpace-Academy / ASE_2023_GROUP_E

https://rando-sando-group-e.vercel.app
2 stars 0 forks source link

Refactoring and Documenting code in _document #476

Open ElzabeEls opened 11 months ago

ElzabeEls commented 11 months ago

Refactoring and Documenting code in _document

WHEN I document and alter the code in _document

THEN I alter and document the code in the following way:

  1. I used .map and filter to iterate over the recipes and obtain only the categories.
  2. We want to display the categories as <option> elements as part of a dropdown.
  3. I could achieve this with a for loop or using reduce as well.
  4. Using a for loop might be faster, but it is harder to read and follow the logic. Using reduce would be more expressive/concise, but given that everyone on the project is relatively junior, it might make it harder for the rest of the team to make changes to it.

WHILE keeping the following points from Schalk in mind: