Tell us what’s happening:
I have the expected output in the project, but I keep getting the same error message: When clicking the button your function should properly update the DOM. Please help me to understand what I’m doing wrong
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
const updateResultsList = () => {
resultList.innerHTML = "";
for (let i = 0; i < units.length; i++) {
let unit = units[i];
if (unit !== unitToConvert.value) {
let convertedQuantity = convertQuantity(unitToConvert.value)(unit)(Number(ingredientQuantity.value));
let li = document.createElement("li");
li.textContent = `${ingredientName.value}: ${convertedQuantity.toFixed(2)} ${unit}`;
resultList.appendChild(li);
}
}
};
// 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 Edg/143.0.0.0
Challenge Information:
Build a Recipe Ingredient Converter - Step 18