function emailExist(e) {
const sqlstmt = "SELECT email FROM somewhere WHERE email = ? LIMIT 1";
db.query(sqlstmt, [e], (err, result) => {
//supposed to return 0 or 1
return result.length
});
}
console.log(emailExist('someone@gmail.com')); //returns undefined
I tried using variables, still returned undefined