Cannot change variable value from query

I am trying to set the value of a variable from the queries I am making, but for whatever reason, is just doesn’t want to, and I cannot find anything to explain it. My code looks just like what it should be based on the API, as far as I can tell.

function checkEmailAgainstPrivateMembers() {

 var tutorQueryResults;
 var studentQueryResults;

    wixData.query("Members/PrivateMembersData")
   .contains("loginEmail", $w('#tutorEmail').value)
   .find()
   .then( (results) => {
     tutorQueryResults = results;
     console.log(tutorQueryResults.totalCount, " results found.");
     console.log(tutorQueryResults.items);
   } );

   wixData.query("Members/PrivateMembersData")
   .contains("loginEmail", $w('#studentEmail').value)
   .find()
   .then( (results) => {
     studentQueryResults = results;
     console.log(studentQueryResults.totalCount, " results found.");
     console.log(studentQueryResults.items);
   } );

   console.log("Tutor email query results: ", tutorQueryResults);
   console.log("Student email query results: ", studentQueryResults);

 if (tutorQueryResults === 1 && studentQueryResults === 1 && $w('#tutorEmail').value.length !== 0 && $w('#studentEmail').value.length !== 0) {
        console.log("Tutor email provided: ", $w('#tutorEmail').value);
        console.log("Student email provided: ", $w('#studentEmail').value);
        console.log("checkEmailAgainstPrivateMembers() returned TRUE");
 return true;
    } else {
        console.log("Tutor email provided: ", $w('#tutorEmail').value);
        console.log("Student email provided: ", $w('#studentEmail').value);
        console.log("checkEmailAgainstPrivateMembers() returned FALSE")
 //
 // Change return value to 'true' for testing without checking input email against Wix Member table
 //
 return false;
    }

I don’t understand your code. What does this line mean:

 if (tutorQueryResults === 1 && studentQueryResults === 1 && $w('#tutorEmail').value.length !== 0 && $w('#studentEmail').value.length !== 0)

And anyway, you can’t use it outside the .then() part of the queries since it relies on the query results.
You should run both queries in parallel like:

Promise.all([
wixData.query("Members/PrivateMembersData")
 .contains("loginEmail", $w('#tutorEmail').value)
  .find(),
wixData.query("Members/PrivateMembersData")
   .contains("loginEmail", $w('#studentEmail').value)
   .find()
])
.then(r => {
let tutorQueryResults = r[0].items;
let studentQueryResults = r[1].items;
if(/*whatever condition you want to test*/){
//do whatever you want
} 
})

Thank you so much! That if statement was just multiple conditions checking to see whether the queries returned a specific result, and that the input boxes actually had something in them.