Look at Line 53,54 of your code.
Did something change? The fCC console used to give line numbers
I’ve never seen the fCC console give an error line number. I wish it were so.
This editor is genuinely frustrating - it is missing basic functionality. Once upon a time it gave line numbers.
console.log(getResults(getRandomQuestion(questions), getRandomComputerChoice(questions.choices)))
this is line 53 that has the prob
So this line is the “top level”. It calls all of your functions so it will always be part of the chain generating an error.
TypeError: Cannot read properties of undefined (reading ‘length’)
Look in those functions for where the length property is accessed
Use console log to make sure the correct object is being accessed, and that it has a length property.
Double check what exactly you are passing to the that function.
Compare these two lines, and look for a difference in what you pass to the function:
console.log(getRandomComputerChoice(getRandomQuestion(questions).choices))
console.log(getResults(getRandomQuestion(questions), getRandomComputerChoice(questions.choices)))
thanks , i succeed specified where the error and fixed it too
because of your tips
thanks very much ![]()
this is the wrong one
getRandomComputerChoice(questions.choices)
and this is the right one
getRandomQuestion(questions).choices))