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


jQuery Utility Methods - Challenge 2 of 2

Challenge Question: Using the 'inArray' method check if the array contains the string 'Andrew'.

Line 1 is from previous question and it passed but when I write Line 2 I get the message that Line 1 is now wrong.

Line 1      var values = $(".required").map(function(){ return $(this).val();});
Line 2      return $.inArray("Andrew", values) != -1;

2 Answers

Typically when you see a message like this it means you've caused a syntax error in this step.

Since you are not in a function, you can't return anything. Simply remove the return keyword and submit it.

John, thanks. That was it.