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

Tell us what’s happening:

Step 103

"For the next phase of the animation you’ll update the paragraphs with the msg text. Since you have the delays for each step of the animation already, you can add your code to the same .forEach() loop.

Add another setTimeout() function. Pass in an empty callback function as the first argument, and pass in the showMsgDelay property of the current object as the second argument."

Having a hard time figuring out how to write the setTimeout() function with the first and second arguments. Any help is appreciated

Your code so far

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

/* file: styles.css */

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

const setTimeout(()=>{}, obj.showMsgDelay) = () => {}

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

Challenge Information:

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

this part is okay (edit: except for the word const. Delete that) It fulfills the request to:

Pass in an empty callback function as the first argument

The problem is what you have written after the comma (the second parameter).
The instructions said:

pass in the showMsgDelay property of the current object as the second argument.

Notice they said that showMsgDelay is a property not a method. (but you seem to be trying to call it?)

Focus on just passing in this variable which is a property of obj

to add, you don’t use const for things that already exist, and setTimeout is a built-in function, no const

i have no idea or forgot how to write it out as a property vs what i already have (obj.showMsgDelay) or what the current object is or basically how to write out the second argument

you just wrote it out in your response so just do exactly that. (the name of the object which is obj, followed by a dot, followed by the name of the property)

ok i finally got it thanks

1 Like