function sailingTimes() {
  var responseAttempts = 0;

  while (responseAttempts < 4) {
    var hawaiiSailing = parseInt(prompt('How many times do you suppose Sharina has sailed from Canada to Hawaii? You have 4 guesses!'));

    if (hawaiiSailing === 2) {
      alert('Twice is correct! She was sailed from Victoria BC to Maui in 2012 and 2014.');
      points++;
      break;
    } else if (hawaiiSailing < 2) {
      alert('Try a little higher');
      responseAttempts++;
    } else if (hawaiiSailing > 2) {
      alert('Try a little lower');
      responseAttempts++;
    } else {
      alert('Please re-try with a number.');
    }
  }
  console.log('Answer 6, var hawaiiSailing, Sharina sailed from Canada to Hawaii twice');

}
// Question 6: Sailing to Hawaii with numeric input with 4 tries
Question 6: Sailing to Hawaii with numeric input with 4 tries
Question 6 : Sailing to Hawaii with numeric input with 4 tries
function sailingTimes() {
  var responseAttempts = 0;
  while (responseAttempts < 4) {
    var hawaiiSailing = parseInt(prompt('How many times do you suppose Sharina has sailed from Canada to Hawaii? You have 4 guesses!'));
    if (hawaiiSailing === 2) {
      alert('Twice is correct! She was sailed from Victoria BC to Maui in 2012 and 2014.');
      points++;
      break;
    } else if (hawaiiSailing < 2) {
      alert('Try a little higher');
      responseAttempts++;
    } else if (hawaiiSailing > 2) {
      alert('Try a little lower');
      responseAttempts++;
    } else {
      alert('Please re-try with a number.');
    }
  }
  console.log('Answer 6, var hawaiiSailing, Sharina sailed from Canada to Hawaii twice');
}
function sailingTimes ( ) { var responseAttempts = 0 ; while ( responseAttempts < 4 ) { var hawaiiSailing = parseInt ( prompt ( 'How many times do you suppose Sharina has sailed from Canada to Hawaii? You have 4 guesses!' ) ) ; if ( hawaiiSailing === 2 ) { alert ( 'Twice is correct! She was sailed from Victoria BC to Maui in 2012 and 2014.' ) ; points ++ ; break ; } else if ( hawaiiSailing < 2 ) { alert ( 'Try a little higher' ) ; responseAttempts ++ ; } else if ( hawaiiSailing > 2 ) { alert ( 'Try a little lower' ) ; responseAttempts ++ ; } else { alert ( 'Please re-try with a number.' ) ; } } console . log ( 'Answer 6, var hawaiiSailing, Sharina sailed from Canada to Hawaii twice' ) ; }
Question 6: Sailing to Hawaii with numeric input with 4 tries
Question 6 : Sailing to Hawaii with numeric input with 4 tries