Learn Basic Debugging by Building a Random Background Color Changer - Step 3

console.log(Math.floor(darkColorsArr.length * Math.random())

You need it within the getRandomIndex function’s {} brackets

function getRandomIndex() {
  console.log(Math.floor(darkColorsArr.length * Math.random())
};

Now show your whole code within the challenge editor.

console.log is missing its closing parenthesis )

1 Like

Please talk with us instead of just pasting your code that you want us to fix for you

1 Like

It talked about it briefly in a previous lesson step, but it didn’t expand.

1 Like

This answer is the KEY. I read your instructions & was able to figure it out.
Thank you!

@mbas - if you haven’t figured this project/step out yet. Reset the lesson, then read the instructions figure out the way that freeCodeCamp wants you to code this step & then if you get stuck, come back to @pkdvalis comment here & read carefully.

Happy Coding!!! :slight_smile:

1 Like