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