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
Scott Magdalein
2,406 PointsUsing the 'inArray' method check if the array contains the string 'Andrew'
I get the error "It looks like Task 1 is no longer passing."
This is my code:
var values = $(".required").map(function(){
return $(this).val();
return values;
});
return $.inArray("Andrew", values);
4 Answers
Scott Magdalein
2,406 PointsGot it to pass by removing "return" from the inArray method. Go figure.
ecp
838 PointsHi Scott - glad it worked out for you ^^ in the future feel free to email us at help@teamtreehouse.com too if you're stuck! Cheers :D
Nicholas Mejia
23,800 PointsCan anyone explain why all we have to do is remove the return portion? I know it didn't ask us to return the value but I'm thinking both Scott and I thought "return" was a given.
Caesar Bell
25,198 PointsFrom my best knowledge you are not returning anything. You are just checking for the values within the array for the string "Andrew", and thats wouldnt be the correct way to return for a value.