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 trialSilvia Correia
747 PointsCode not accepted
function returnValue (hours){ var echo = "I work " + hours + " a week"; return echo; } returnValue ("50h");
Why is this code not working?!
1 Answer
Brian Foley
8,440 PointsHello,
It looks like the challenge wants you to return the parameter of the function. Your parameter in this case is hours, so it'd look like this:
function returnValue (hours) { var echo = "I work " + hours + " a week"; return hours; }
Hope that helps! :)
Silvia Correia
747 PointsHi Brian! Thanks for your help! It did work :)
Edmund Southgate
12,056 PointsEdmund Southgate
12,056 PointsInteresting...I ran it in the console in Chrome. It worked if I entered the value as a string as you have done here. It didn't work when I ran returnValue(50h); with no quotes. I'm wondering if this is the problem? If you put it without quotes the interpreter will be looking for a variable named 50h which would be invalid as variables can't begin with numbers in JavaScript.