I'm currently working on looping through an array to verify the existence of email, phone, and alternate phone in a database. My challenge lies in finding a suitable function or workaround in AngularJS that allows me to iterate through the array with specified variables.
$scope.dataCheck = {
email: $scope.TheEmail,
phone: $scope.ThePhone,
AltPhone: $scope.TheAltPhone
}
I attempted to use indexOf as shown below but it didn't yield the desired results:
if ($scope.dataCheck.indexOf($scope.TheEmail)) {
// Call a function to check if the email exists and return
}
Thank you!
It's worth noting that I am utilizing ExpressJS and I am relatively new to JavaScript.