function aboutMeQuiz() {
  var userScore = 0;
  var questionArray = ['Am I a Male? (y/n or yes/no)',
    'Am I from North of Jordan? (y/n or yes/no)',
    'Am I from Al-Karak city? (y/n or yes/no)',
    'Do I have a Bachelor Degree in Chemistry? (y/n or yes/no)',
    'Do you think my name is Omar Tarawneh? (y/n or yes/no)'
  ];
  var questionAns1 = ['yes', 'no', 'yes', 'yes', 'yes'];
  var questionAns2 = ['y', 'n', 'y', 'y', 'y'];
  // loob through the question and the answers
  for (let i = 0; i < questionArray.length; i++) {
    var userAns = prompt(questionArray[i]).toLowerCase();
    while(userAns !== 'yes' && userAns !== 'no' && userAns !== 'y' && userAns !== 'n'){
      userAns = prompt(questionArray[i]).toLowerCase();
    }
      if (userAns === questionAns1[i] || userAns === questionAns2[i]) {
        // console.log('Correct');
        alert('Correct');
        userScore += 1;
      }
       else {
        // console.log('No, you are not Correct.');
        alert('No, you are not Correct.');
      }
  }
  return userScore;
}
/* Stretch Goals

    [x] but the question and answers and loop through them
    [] generate a random numbers as your correct answer
*/
Stretch Goals
[x] but the question and answers and loop through them
[] generate a random numbers as your correct answer
Stretch Goals [ x ] but the question and answers and loop through them [] generate a random numbers as your correct answer
function aboutMeQuiz() {
  var userScore = 0;
  var questionArray = ['Am I a Male? (y/n or yes/no)',
    'Am I from North of Jordan? (y/n or yes/no)',
    'Am I from Al-Karak city? (y/n or yes/no)',
    'Do I have a Bachelor Degree in Chemistry? (y/n or yes/no)',
    'Do you think my name is Omar Tarawneh? (y/n or yes/no)'
  ];
  var questionAns1 = ['yes', 'no', 'yes', 'yes', 'yes'];
  var questionAns2 = ['y', 'n', 'y', 'y', 'y'];
  for (let i = 0; i < questionArray.length; i++) {
    var userAns = prompt(questionArray[i]).toLowerCase();
    while(userAns !== 'yes' && userAns !== 'no' && userAns !== 'y' && userAns !== 'n'){
      userAns = prompt(questionArray[i]).toLowerCase();
    }
      if (userAns === questionAns1[i] || userAns === questionAns2[i]) {
        alert('Correct');
        userScore += 1;
      }
       else {
        alert('No, you are not Correct.');
      }
  }
  return userScore;
}
function aboutMeQuiz ( ) { var userScore = 0 ; var questionArray = [ 'Am I a Male? (y/n or yes/no)' , 'Am I from North of Jordan? (y/n or yes/no)' , 'Am I from Al-Karak city? (y/n or yes/no)' , 'Do I have a Bachelor Degree in Chemistry? (y/n or yes/no)' , 'Do you think my name is Omar Tarawneh? (y/n or yes/no)' ] ; var questionAns1 = [ 'yes' , 'no' , 'yes' , 'yes' , 'yes' ] ; var questionAns2 = [ 'y' , 'n' , 'y' , 'y' , 'y' ] ; for ( let i = 0 ; i < questionArray . length ; i ++ ) { var userAns = prompt ( questionArray [ i ] ) . toLowerCase ( ) ; while ( userAns !== 'yes' && userAns !== 'no' && userAns !== 'y' && userAns !== 'n' ) { userAns = prompt ( questionArray [ i ] ) . toLowerCase ( ) ; } if ( userAns === questionAns1 [ i ] || userAns === questionAns2 [ i ] ) { alert ( 'Correct' ) ; userScore += 1 ; } else { alert ( 'No, you are not Correct.' ) ; } } return userScore ; }
Stretch Goals
[x] but the question and answers and loop through them
[] generate a random numbers as your correct answer
Stretch Goals [ x ] but the question and answers and loop through them [] generate a random numbers as your correct answer
// loob through the question and the answers // console.log('Correct'); // console.log('No, you are not Correct.');