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

Steve Muthig
4,225 PointsCode Challenge Help - What am I missing??
Create a method called 'requiredValues' that returns an array of all the values of inputs with the class of 'required'.
Oops! It looks like Task 1 is no longer passing.
function isValidEmail(email){
return email.indexOf("@") != -1
}
var $required = $(".required");
function requiredValues(){
var blanks = new Array();
$required.each(function(){
blanks.push($this).val() != "");
});
required blanks.sort().pop();
3 Answers

Adrianne Geyer
7,180 Pointsfunction requiredValues() {
var blanks = new Array();
$('.required').each(function() {
blanks.push($(this).val());
});
return blanks;
}
Instead of creating a variable for the 'required' class, I simply plugged it in directly to reduce the lines of code. I only created 1 variable for the array and named it blanks

Aaron Arkie
5,345 Pointsyou may have changed the code from the previous example, go back and do the challenge before this one, when you get to this challenge again don't delete or move anything from the previous example, i hope this helps!

Steve Muthig
4,225 PointsAAaron If I remove the code from the 2nd challenge without changing the code from the first challenge there is no problem with the first challenge passing