DietTable

DietTable receives a foodArray. foodArray is an array of arrays. Each intern array are all the nutrients of each food. In the first step we declare an empty array.

We map each item of the array and check if we have the nutrient we are checking in the array we declare at first. If we don't have it then we add it. If we have it then we just sum the mount.

This function must be changed because we will no longer use food directly from the USDA but directly from our database

FoodPortions

This function receives an array of portions in the format of the USDA API and returnst it in a form simpler to manage.

This function must be changed because we will no longer use food directly from the USDA but directly from our database