Errors with assignment 1


https://repl.it/@Ranestav/assignment-1-candidate-testing-ranestav#candidate-testing.js

Over the past 5 hours or so I’ve struggled to fix errors within my code. It works in that I get the desired final result, but it seems to not be done exactly right based on what the assignment wants through github. I think the issue may be with my use of console.log as opposed to return, but I cannot figure out how to make return work. I’ve tried googling my problems and reading other people forum posts, but to no avail.

https://repl.it/@Ranestav/assignment-1-candidate-testing-ranestav#candidate-testing.js

I’ve managed to fix the strange issue with "Given the array [8, ‘Orbit’, ‘Trajectory’, 45], what entry is at index 2? ". It wanted the " and ’ swapped.

I am still stuck on the undefined issue however.

1 Like

Without seeing the errors it looks like you just need to add a return statement for the gradeQuiz function so that the auto grader doesn’t see your output as undefined.

Thank you so much for your help. I tried adding a return statement previously, but I had forgotten that return statements end the function immediately and placed it incorrectly. Everything is working perfectly now. Have a great week!

Thank you, this was helpful.