## Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

### Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today. # Why doing this will not give me the right result?

Here is my code, I find no matter what answer I gave, the correctAnswer is always 3. I learn that if I correct ' if (answers=quiz[i])' to' if (answers==quiz[i])', the program run correctly. But it doesn;t make sense why (' if (answers=quiz[i])')doesn't work.

```const quiz=[
['What year is it?','2020'],
['What\'s the relative of hamburger','hotdog'],
['who is the president of the US?','Donald Trump']
];

for (let i=0;i<quiz.length ;i++){
}
}

```

Hi Ziyu,

First of all you're setting let answer to equal to the question phrase and not the actual answer. The answer is located at index 1 like this:

```let answers=prompt (quiz[i]);
```

On the next line you're setting answer to equal something new, instead of checking if the value actually equals the one contained inside the answer constant.

= is an ansignment operator.

For comparison you need to use == and ===

Marcus Klausen , Ziyu Zhang code reference to the

```answer = prompt (quiz[i]);
```

is just fine. This is setting your input to equal the answer at the current iteration.

Ziyu Zhang issue is exactly the single = assignment operator.

This was my solution that works.

```const questions = [

['What is the color of an apple?', 'red'],
['How many inches in a foot?(number only)', '12'],
['What is the color of a banana?', 'yellow']

]
let correct = 0;

for(let i = 0; i < questions.length; i++){