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 trialRichard Carthon
863 PointsI feel I have accurately answered this equation but I am not getting the answer
please help me get the right answer because I am unsure of what I am doing wrong
// Enter your code below
var initialScore = 8
initialScore = ++8
var totalScore = initialScore
3 Answers
Fuad Adetoro
iOS Development Techdegree Student 11,599 PointsYou need to use the increment whilst creating the const/variable.
let totalScore = ++initialScore
Fuad Adetoro
iOS Development Techdegree Student 11,599 PointsThe answer answered your question so give it a thumbs up so others know it's answered (and to show appreciation for someone helping you).
Dave Berning
17,365 PointsHi Richard,
Here is the answer for tasks 1 and 2. Create a constant totalScore and assign it to the incremented score. The constant, isWinner is checking if the score is not 10. If the score is anything else but 10, you win.
// Enter your code below
var initialScore = 8
let totalScore = ++initialScore
let isWinner = totalScore != 10
Hope this helps, Dave
Richard Carthon
863 PointsRichard Carthon
863 Pointsturns out the answer was
let totalScore = +initialScore
Thanks for your response though