Learn Recursion by Building a Decimal to Binary Converter - Step 96

Tell us what’s happening:

Hi team!

I have tried this one multiple times. When I write “5” and click “convert” the animation works and it shows three numbers in the call stack.

Code:

const showAnimation = () => {
  result.innerText = "Call Stack Animation";

  animationData.forEach((obj) => {
    setTimeout(() => {
      animationContainer.innerHTML += `
        <p id="${obj.inputVal}" class="animation-frame">${decimalToBinary(obj.inputVal)}</p>
      `;
    }, obj.addElDelay);
  });
};

---- Thanks

Your code so far

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

/* file: styles.css */

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

        <p id="${obj.inputVal}" class="animation-frame">${decimalToBinary(obj.inputVal)}</p>

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36

Challenge Information:

Learn Recursion by Building a Decimal to Binary Converter - Step 96

Welcome to the forum @marlyelizabeth10

You should use string interpolation to set the text of the paragraph element to decimalToBinary(${obj.inputVal}) .

Carefully look at the hint message to see where the curly braces are placed.

Happy coding

I love you told me the actual code! And also your profile pic is a parrot, I love parrots (and I have one) hahahaaha thanks for your support but that was what I actually tried already and it seems like there was a bug cuz it worked until I tried for the 20th time. Thanks again!