Bummer! You must be logged in to access this page.

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

Jquery utility method

i am not understanding why this is wrong!!!

var values = $(".required").map(function(){ return $(this).val();}); return $.inArray('Andrew', values);

}

5 Answers

Try taking out:

return $.inArray('Andrew', values);

And mess around with the semi colons at the end.

Also you have an extra curly brace at the end.

Got 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]

i figured it out thanks.

@Shannon Yeh: I am having the same problem so what did you do to sort that out?

i 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!

A'ight thanks