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

JavaScript

Lillyanne Yanez
Lillyanne Yanez
1,102 Points

Difficulty 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; }

Lillyanne Yanez
Lillyanne Yanez
1,102 Points

Apologies for not attaching a picture of the workspace. I just noticed the formatting changed after submitting my questions.

1 Answer

Steven Parker
Steven Parker
231,269 Points

When 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?