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
Rodrigo Muñoz
Courses Plus Student 20,171 PointsHelp with jQuery excercise
Hi everyone, I'm stacked with this excercise since few days ago.
Create a method called 'requiredValues' that returns an array of all the values of inputs with the class of 'required'.
Here is what I did: function requiredValues(){ new Array(); $(".required").each().push($(this).val() == "");
Any advice so I can solve this and then keep going?
3 Answers
Andrew Chalkley
Treehouse Guest TeacherHi Rodrigo,
I've helped some students over on this thread. Take a look there and if your still having problems let me know.
Regards Andrew
Rodrigo Muñoz
Courses Plus Student 20,171 PointsSolved. Needed the map function but the tutorial is on the next video.
Regards
Andrew Chalkley
Treehouse Guest TeacherThe code challenges don't always test what methods you use but test the result of the function you created.
So if you were to declare an array before, use the each() method to iterate over the inputs and then push them on to the array manually, which was a technique shown in the video prior it would have passed too.