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 Foundations Functions Return Values

Alan Bothe
Alan Bothe
14,352 Points

Is it just me or is this challenge ridiculous?

The video does not provide syntax for passing arrays in a function OR making multiple comparisons with if/else.

2 Answers

Alan Bothe
Alan Bothe
14,352 Points

Not sure I could reproduce it with certainty, but it was close to the OP on another forum post https://teamtreehouse.com/forum/stuck-on-functions-stage-5-code-challenge. Make sure you use the same name in the body as in the parameter. You don't actually need curly braces around an if/else unless its more than one line, which these aren't. If you send me your code I can troubleshoot. Good luck.

Alan Bothe
Alan Bothe
14,352 Points

got it. basically used trial and error until it took my answer. it'd be nice if the site would let me copy the correct code without having to refresh the page and enter it again.

Matthew Padich
Matthew Padich
2,886 Points

Any chance you can share your code? Having the same issue and stackoverflow seems to be confounding the issue for me.

Thanks!!