Old lesson checkpoints

The statement " if (sale=true) " outputs the same result as the statement " if (sale) " yet the exercise marks this as incorrect, saying that the statement assigns sale the value of true. Is this just a matter of making the code more concise?

5 Likes

Yeah, I saw this too. The directions didn’t even introduce the comparison operators yet, but I got the message at the bottom of the console saying that I should use a comparison operator instead of =, because that is assigning a value.

1 Like