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.

JavaScript

Form Validation and Manipulation - Checking Values. Can't finished Challenge 2

I can't finished my work, and I don't know what's wrong.

Challenge task 2 of 3:

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

My code:

function isValidEmail(mail) {
    return mail.indexOf("@") != -1;
}

function requiredValues() {
  var total = new Array();
  $("input .required")each(function(){
    total.push($(this).val());
  });  
    return total;
}

And I get this answer:

Oops! It looks like Task 1 is no longer passing.

What's wrong, where is my mistake

2 Answers

Zen Hess
Zen Hess
6,700 Points

Johannes V,

Your code is very close. Look back through your punctuation. JavaScript is very finicky.

Thanks for thoroughly asking the question!

Thank's.. I find the points...