Need help: "Challenge: Rabbit Racer" (I'm confused)
For some reason I am confused about how this specific line or two of code is meant to be written.
var btn1 = new Button({ x: , y: , width: , height: , color: color(), label: , onClick: function() { rabbits[].(); } });
I think I understand I need to call the onClick to the Rabbit.prototype.hop ?
But I don't think I understand how/where.
I tried writing "rabbits[hop].();" but then it says hop is not defined.
I feel like I've forgot the entire first JS course all of a sudden.
I looked back on the arrays class and I still didn't understand. Am I stupid?
Edit: I've never been this confused about JS before since I started learning.
I made sure I understood everything perfectly well before moving on every previous class and right now I'm so lost I'm convinced I lost my brain.
This function format seems 100% new to me, and is appearing for the first time in a Challenge.
I tried googling this to no avail.
Vui lòng đăng nhập để lại bình luận.