Build a Recipe Ingredient Converter - Step 18

Tell us what’s happening:

Hello There,
could you help to find what is the issue in this question , please ?

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

const updateResultsList = () => {
  resultList.innerHTML = "";

 units.forEach(item => {
  if(item !== unitToConvert.value){
    const convertedQuantity = processIngredient(ingredientQuantity.value)(unitToConvert.value)(item)(numberOfServings.value)
    const newListItem = document.createElement('li')
    resultList.appendChild(newListItem)
    newListItem.textContent += `${ingredientName.value}: ${convertedQuantity} ${item}`
   }
  })
}  
  






// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36

Challenge Information:

Build a Recipe Ingredient Converter - Step 18

First thing I recommend doing is running your code in the preview and filling it out with the example values.

That should tell you a little more about where to look. And I want to help you figure out how to debug your code rather than nudge you towards a solution.

1 Like

Thank you for your reply. Could you please explain how to run and test the code?

Fill in some values in the app and click Convert.

Use console.log() liberally in your code to watch what happens with your variables. Are the values as expected?

thank you, I get it.