What I expect to happen: Student is trying to randomly select a president (from 1900 to present) and have the correct data placed into the “Name” and “Home State” areas What actually happens: SHows as UNDEFINED What I’ve tried: making it worse:)
In the for loop on line 20, it isn’t looping or running the code because presidentsNameList has to have the .length at the end. Without it, the variable i is being compared to the whole list instead of how long it is, resulting in the arrays not being filtered and the undefined
On line 20,
for (var i = 0; i < presidentsNameList; i++) {
Becomes:
for (var i = 0; i < presidentsNameList.length; i++) {