JavaScript JavaScript Arrays Multidimensional Arrays Improve the Quiz – One Solution

Esther AlQaisi
Esther AlQaisi
2,311 Points

Correct/Incorrect questions only displaying "NaN"

Here's a snapshot of my workspace: https://w.trhou.se/rebbdjzx0r

Not sure why the HTML values for the questions are "NaN." Any help is appreciated!

2 Answers

Jamie Moore
Jamie Moore
3,595 Points

Hey Esther,

You're super close to getting this one done, but there's one tiny error which is causing confusion.

for ( let i = 0; i < arr.length; i++ ) {
    items =+ `<li>${ arr[i] }</li>`;
}

Your for loop which creates the list elements has one tiny typo. The items =+ should be items +=.

Hope this helps!

Esther AlQaisi
Esther AlQaisi
2,311 Points

I knew I was overlooking some minor detail! I'm relieved. Thank you for pointing it out.