Object building practise,unable to get the expected output

My code is not working expected, The balls are not created.plz help me.
Also I have my code inside the class itself, I get an error @ const balls =[], Iam unable to understand why it is behaving that way.
Here is my link to codepen:

I see that all bouncing balls are some transparent to dark black in color, how to resolve this? I need colorful balls. And also in the function, I have given random(), but still I dont know what is wrong.

Hi @vaishnavi_A.N

This one was tricky to find. :sweat_smile:
You have a space between rgb and ( in the randomRGB() function.

Additionally, you need to change the > to < in the while loop condition. So that the loop runs 25 times.

Happy coding,
Michael

1 Like

I didn’t ever think that a space between rgb and bracket would cause a program not to work.
Thabj u so much @mikoMK.

1 Like