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
Shannon Yeh
8,987 PointsJquery utility method
i am not understanding why this is wrong!!!
var values = $(".required").map(function(){ return $(this).val();}); return $.inArray('Andrew', values);
}
5 Answers
Chase Lee
29,275 PointsTry taking out:
return $.inArray('Andrew', values);
And mess around with the semi colons at the end.
Chase Lee
29,275 PointsAlso you have an extra curly brace at the end.
Ben Anggoro
36,161 PointsGot the same problem and it was driving me nuts but then I got green after i change browser to chrome
Challenge 1/2 : [pre] var values = $('.required').map(function(){ return $(this).val(); }); [/pre] Didn't work when im on FireFox, but I got green when I switch to chrome. 4 hours wasted cause of that.
Challenge 2/2 - you don't need to return it as the instruction said "to check if..." and not "to return "Andrew". So on the next line after the closing bracket }); [pre] $.inArray("Andrew", values); [/pre]
Shannon Yeh
8,987 Pointsi figured it out thanks.
Bassey Orok
Courses Plus Student 7,492 Points@Shannon Yeh: I am having the same problem so what did you do to sort that out?
Shannon Yeh
8,987 Pointsi honestly forgot how i even solved the problem. pretty much i restarted over and over until i got it right. anyhow just play around with the syntax, return.
my tip is to screenshot after every lesson it really helps!
Bassey Orok
Courses Plus Student 7,492 PointsA'ight thanks