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 trial

iOS

becky hayes
becky hayes
2,226 Points

Fun facts app - I'm a total newbie and struggling to understand why my code isnt compiling

It appears to be the same as the tutor's but i'm getting the following alerts: 'variable xx was never mutated - consider changing'

You can see a screen shot here! http://prntscr.com/a6pugu

Steven Deutsch
Steven Deutsch
21,046 Points

Hey Becky Hayes,

Try changing those to var declarations to lets if they are never mutated. Next, you should do a product clean. Finally, do you mean to have that breakpoint on line 28? Drag the blue arrow on the line number off of it to remove it.

2 Answers

Jari Koopman
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Jari Koopman
Python Web Development Techdegree Graduate 29,349 Points

HI Becky,

Your code is compiling because a var takes more memory in the app because the app has to check if it changed all the time. But a yellow error just means you could do something better, not that something is wrong. So your code should run fine, but if you change the var to let, the errors should disappear.

Hope this helped out,

Greets, Jari

There is no problem with this issues, it is just some kinf of advising.My code has the same thing but it still compiles, don't worry about that