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 trialJahan Zeb
11,169 PointsStuck at code challenge 3rd task
Hi experts, I am stuck at 3rd task of the code challenge. Could anyone please help me out?
The first two tasks are passing fine:
function isValidEmail (email) {
return email.indexOf("@") !== -1;
}
function requiredValues () {
var myArray = new Array;
$(".required").each(function () {
myArray.push($(this).val());
});
return myArray;
}
Now this one wont and in fact it sends me back to 1st task:
function containsBlanks () {
var blanks = new Array;
$(".required").each(function () {
blanks.push($(this).val() == "");
}
return blanks.sort().pop();
//or return blanks.indexOf(true) !== -1;
}
2 Answers
Jason Anello
Courses Plus Student 94,610 PointsHi Jahan,
The logic looks fine. You didn't properly close off the .each
method. You were missing the closing )
and ;
Jahan Zeb
11,169 PointsThanks a lot Jason for pointing out the syntax error. I think I need to stop working too late in the night.
Jason Anello
Courses Plus Student 94,610 PointsYou're welcome.