So the description of whats wanted in this challenge is written as:
Attach an event listener in the componentDidMount() method for keydown events and have these events trigger the callback handleKeyPress() . You can use document.addEventListener() which takes the event (in quotes) as the first argument and the callback as the second argument.
I can wrap my head around what they are asking for, but really have no idea how to put what they are asking for in code (this is happening more and more as these challenge progress, essentially zero discussion on formatting). How in the flying fuck, from that description, is a person suppose to deduce that document.addEventListener() is supposed to be formatted as
document.addEventListener(event, function, optional(useCapture)).
Oh, you highlighted “keydown” in the description? And (after finding out what keydown was via google since it was never mentioned before) I need to enter it as if it’s a prop with " " around it like it’s a string? Totally would have just guessed that. Why isn’t it this kind of thing ever brought up? I’ve always been good at math and finding solution to problems. Over and over again (especially towards the end of the javascript section) I can figure out how the problem should be solved, what methods would work for it, but I’m constantly just baffled as to how to put that in code, as essentially zero time goes into discussing how things need to be formatted (semi-colon at the end of this line? oops syntax error, separate these items with commas? syntax error).
Is every other code learning resource just as dysfunctional? You just hear over and over again how great FCC is…