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 JavaScript Basics (Retired) Creating Reusable Code with Functions Getting Information From a Function

Coffee function

Hi,

i got a problem with a function which is get coffee that i gave to my girlfriend.

Every time I call the function it returns F off.

How do I fix this?

Please post your code.

2 Answers

Alex Heil
Alex Heil
53,547 Points

hey Tom Lawrence , there are quite some ways you can try to fix it.

1 - try turning her off and on again

2 - try other functions first before calling the getCoffee() one, ways that seem to work would be:

a) giveRing()

b) buyShoes()

c) takeOutGarbage()

and many others. just try them out and use whatever suits best ^^

if this all doesn't work and you still get the same result back from your function then you might have to use the getCoffeeMyself() one instead - this will always work :D

hope that helps and have a nice day ;)

There's also a little know function called askAboutHerDay() you could try. I'd run that before getCoffee() and see what happens :)