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

hai

I have a problem, Im in the 63 step of building a decimal to binary converter, the instrucions say " In your base case, log Reached base case to the console."

im trying to log ‘countDownAndUp(3)’ but i get and error “You should log Reached base case to the console in your base case.”

idk what it mean by REACHED BASE CASE

thanks for the help

my code:

const countDownAndUp = (number) => {
console.log(number);

if (number === 0) {

// User Editable Region

console.log(countDownAndUp(number - 1))

// User Editable Region

return;

} else {
countDownAndUp(number - 1);
}
};

countDownAndUp(3);

Welcome to the forum @Memodamus

For this step, just console.log the text mentioned in the instructions.

Happy coding

thank u, i spent 2 hrs thinking about complicated ways to solve it

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.