Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Brian Schmitz
11,167 PointsFinding the values of the array in the class of required.
Can someone please help correct this code to pass the challenge. Need to add the array to the values of the class required.
function isValidEmail (email) {
return email.indexOf ("@") != -1;
};
var $required = $(".required");
function requiredValues () {
var blanks = new Array();
$required.each (function () {
}
return blanks.push($(this).val());
}

Jason Anello
Courses Plus Student 94,592 PointsI hadn't seen your comment yet when I posted.
1 Answer

Jason Anello
Courses Plus Student 94,592 PointsHi Brian,
You don't have anything inside the curly braces for the anonymous function passed into the .each
method. Your blanks.push
statement should go in there and then when that's done looping you can return the blanks array at the end of the requiredValues
function.
var $required = $(".required");
function requiredValues () {
var blanks = new Array();
$required.each (function () {
blanks.push($(this).val());
});
return blanks;
}

Brian Schmitz
11,167 PointsNo problem, thanks for helping anyway. Do you have an idea on the other post I put up with finding "Andrew" in the array. Can't figure out where I'm wrong there

Jason Anello
Courses Plus Student 94,592 PointsCan you add the link in your other post?

Brian Schmitz
11,167 PointsI added the link to the challenge. Let me know if you were looking for something else. I passed the first challenge but hit a snag on the second. I know its something pretty simple I'm missing.
Brian Schmitz
11,167 PointsBrian Schmitz
11,167 PointsNever mind, figured this one out. Thanks