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

General Discussion

Code Challenge: Task 2 of 3 Checking Values in Build an Interactive Website Project

My first task was passing and yet I keep getting the error that my first task is no longer passing even though I didn't do anything to impact my first task. (shown in lines 1-3). According to other forum posts the code on lines 5-12 should be passing, but alas it's not.

Here is the challenge: Create a method called 'requiredValues' that returns an array of all the values of inputs with the class of 'required'.

function isValidEmail (email) {
    return email.indexOf('@') != -1;
};

var $required = $('.required');
function requiredValues(){
    var values = new Array();
  $required.each(function(){
    values.push($(this).val()));
  };
  return values;
};

1 Answer

Nevermind, paranthesis error! :p