I'm trying to return variables as true or false via a function. I want to do it this way so I can call ajax only once, and receive both variables back in one function. However, I'm having trouble returning the variable. Here is my code:
var emailExists = false;
var userExists = false;
function checkExisting(emailExists,userExists) {
var emailExists = true;
return emailExists;
}
alert(emailExists);
What I can't figure out is why the alert gives me false, when I thought it'd be giving me true. What's wrong with this setup?