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!
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 trial

Roman Smolkin
469 PointsSimplify increment/decrement into changeScore function? But what's the syntax for passing a 1 or an -1 to changeScore?
Since increment and decrement score functions are so similar, it's probably better to use use one function for ChangeScore that take a parameter of 1 or -1. But I'm not sure exactly what that syntax should be. Also, if the initial state was coming from a value in DB and needed to be synced between this app on several devices where anyone pressing the button to increment or decrement would update all the other ones, that's an example I'd love to see.
Charles Wanjohi
9,235 PointsCharles Wanjohi
9,235 PointsA function that takes the totalScore and either 1 or -1 can achieve this:
Hope this help you.If not let me know