ga-wdi-exercises / project1

[project] GA- Project 1
3 stars 75 forks source link

trying to loop through an array inside an object #183

Closed matiamin closed 9 years ago

matiamin commented 9 years ago

Trivia project.

I'm trying to loop through array values inside objects in an array, but code isn't executing. See below the line of code I tried. Goal is to loop through each array value because I've set multiple answers for each question.
https://github.com/matiamin/mati_Project1/blob/mati_solution/script.js#L27

amaseda commented 9 years ago

Hey Mati,

What exactly do you mean by not executing? Is the code in your event listener not running at all? Try moving your event.preventDefault() to the top of your event listener.

adambray commented 9 years ago

Hey Mati,

just reiterating Adrian's question... what do you mean it's not executing? (in general, the loop part of the code looks correct"). Have you tried using console.log statements to see what's going on?

matiamin commented 9 years ago

Instead of going through each array value of first object, it is looping through the first array value of all three objects. Not sure if I'm asking this correctly.

adambray commented 9 years ago

Are you getting any errors in the JS console when you run your code?

adambray commented 9 years ago

(If so, can you paste them here?)