Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialChristopher J Doyle
682 Pointshaving a little issue on the not operator.
initialScore = 8 initialScore += 1
let isWinner = !10
I know I'm making a mistake on the not operator. I have tried 3 different combinations. Anybody available to help, please?
// Enter your code below
var initialScore = 8
initialScore += 1
let isWinner = !10
2 Answers
Steven Parker
231,236 PointsIt's not the number 10 you want to use the "not" on, it's the comparison operator. And you need to involve the score in the comparison and then assign the result to the new constant. So it might look like this:
let isWinner = initialScore != 10
Happy coding! And for some holiday-season fun and extra practice, give Advent of Code a try!
Christopher J Doyle
682 PointsI tried that code earlier before I asked for help... let me try it again..Thank you Steven
Steven Parker
231,236 PointsChristopher J Doyle @mdash; if it doesn't solve the issue, post again. And if it does, you can mark the question solved by choosing a "best answer".
Happy coding!