{"size": 876, "ext": "js", "max_stars_repo_path": "fodmapFinder.js", "max_stars_repo_name": "BenPritch00/Fodmap_Finder", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "fodmapFinder.js", "max_issues_repo_name": "BenPritch00/Fodmap_Finder", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "fodmapFinder.js", "max_forks_repo_name": "BenPritch00/Fodmap_Finder", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 38.0869565217, "max_line_length": 179, "alphanum_fraction": 0.7054794521}
// write a function, that given a list of fodmaps and a string containing a list of ingredients seperated by a comma, determines whether the recipe has any high fodmap ingredients
const sampleRecipe = "garlic, potatoes, cherries, butter" 

const sampleFodmaps = ["garlic", "onion", "milk"]

function recipeChecker(recipe, fodmaps) {
    // convert our recipe to a list of words
    // Check each ingredient in our recipe to see if it's a fodmap
    const recipeArr = recipe.split(',');
    for (let i = 0; i < recipeArr.length; i++) {
        if (fodmaps.includes(recipeArr[i])) {
            console.log(recipeArr[i]);
          }
    }
}

function checkTextBoxRecipe() {
    const recipeInput = document.getElementById('recipeInput').value;
    recipeChecker(recipeInput, sampleFodmaps)
}

const submitButton = document.getElementById("submit").onclick = checkTextBoxRecipe
