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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Vince Leung](https://secure.gravatar.com/avatar/89b86e0f9007bd41498b87eb1e6c1f3b?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Vince Leung
4,730 PointsJavascript function not working.
I can't seem to get my simple function code to work. Am i missing something?
function returnValue(math){
var addition = math + 10;
return addition;
}
console.log( returnValue (12) );
![Vince Leung](https://secure.gravatar.com/avatar/89b86e0f9007bd41498b87eb1e6c1f3b?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Vince Leung
4,730 PointsThanks Ashish. Maybe has to do with spacing or formating of my code, i heard treehouse challenges has to have a specific formating an order for your code to pass.
In terms of my code, i keep getting this message " Bummer! Make sure you return the argument that's passed into the function. In other words type return
, a space, and the parameter name."
![Ashish Mehra](https://uploads.teamtreehouse.com/production/profile-photos/6176932/micro_profile.jpg)
Ashish Mehra
Courses Plus Student 340 Pointscan u please paste the link of challenge
![Vince Leung](https://secure.gravatar.com/avatar/89b86e0f9007bd41498b87eb1e6c1f3b?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Vince Leung
4,730 PointsI'm not 100% sure if this is going to work but: https://teamtreehouse.com/library/javascript-basics/creating-reusable-code-with-functions/passing-an-argument-to-a-function
If not, it is called "Challenge Task 1 of 2" under javascript basics
![Vince Leung](https://secure.gravatar.com/avatar/89b86e0f9007bd41498b87eb1e6c1f3b?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Vince Leung
4,730 PointsGreat! appreciate it, maybe i just made the challenge little too complicated LOL
Thanks Ashish appreciate it!
Vince
![Ashish Mehra](https://uploads.teamtreehouse.com/production/profile-photos/6176932/micro_profile.jpg)
Ashish Mehra
Courses Plus Student 340 Pointsyour welcome and happy coding
1 Answer
![Ashish Mehra](https://uploads.teamtreehouse.com/production/profile-photos/6176932/micro_profile.jpg)
Ashish Mehra
Courses Plus Student 340 Pointstry this it will work as u only need to do these thing in challenge
function returnValue(math){
return math;
}
var echo = returnValue("Hy");
![rydavim](https://uploads.teamtreehouse.com/production/profile-photos/1857952/micro_scarabTattoo.jpg)
rydavim
18,814 PointsI've changed your comment to an answer so that it may be voted on or marked as best answer.
Ashish Mehra
Courses Plus Student 340 PointsAshish Mehra
Courses Plus Student 340 PointsHey vince I run your code in my system as well as in browser console and i found it is working. I got 22 as a return value in console