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 trialLillyanne Yanez
1,102 PointsDifficulty doubling a number from a previous variable
While I'm not getting a syntax error, I can not get the function to double. Any help or guidance would be appreciated. Thank you
let houses = 7; function doubling(houses) { houses*= 2; return number; }
1 Answer
Steven Parker
231,261 PointsWhen posting code, use Markdown formatting to preserve the code's appearance and retain special symbols.
This function takes an argument named "houses" and doubles it, but it is returning something named "number" instead (which does not seem to be defined anywhere in the code shown). Perhaps you intended to return houses
?
Lillyanne Yanez
1,102 PointsLillyanne Yanez
1,102 PointsApologies for not attaching a picture of the workspace. I just noticed the formatting changed after submitting my questions.