Build a Recipe Ingredient Converter - Step 17

Tell us what’s happening:

Hi, can’t pass this test, I even capitalize the name and my output is excatly what it seems should be. I’ve even tried to pluralize the unit when needed, but nothing. Can you tell me where I’m wrong?
I appreciate any help.

Your code so far

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

/* file: styles.css */

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

const updateResultsList = () => {
  resultList.innerHTML = "";
  const name = ingredientName.value;
  const capName = name.charAt(0).toUpperCase() + name.slice(1);
  
  units.forEach((unit) => {
    if (unit !== unitToConvert.value){
      const finalQuantity = processIngredient(ingredientQuantity.value, unitToConvert.value, unit, numberOfServings.value);
     
  
      const li = document.createElement('li');
      li.textContent = `${capName}: ${parseInt(finalQuantity)} ${unit}s`;

      resultList.appendChild(li);
    }
  })
}

recipeForm.addEventListener("submit", updateResultsList);




// 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/136.0.0.0 Safari/537.36

Challenge Information:

Build a Recipe Ingredient Converter - Step 17

Never mind, I figured out, btw I think this step is a bit misleading. The examle given is ‘Flour: 5 grams’, that shows a capitalize ingredient name, an integer and a pluralize unit, but if you try to get the same format, you don’t pass the test !!

can you report this as a bug?

Thank you for helping make FCC better. Bugs can be reported as GitHub Issues. Whenever reporting a bug, please check first that there isn’t already an issue for it and provide as much detail as possible.

1 Like