js/app.js
//checks if user prompt can get the y/n answer, but makes sure its y/n
checks if user prompt can get the y/n answer, but makes sure its y/n
checks if user prompt can get the y / n answer but makes sure its y / n
function questionTwo() {
  var kids = prompt('Does Alex have wonderful little boys?').toLowerCase();
  console.log('Does Alex have wonderful little boys?; ' + kids);
  var wrongType = true;
  while (wrongType === true) {
    if (kids === 'y' || kids === 'n' || kids === 'yes' || kids === 'no') {
      wrongType = false;
    } else (alert('I am not a very smart program, please keep responses to yes/no or y/n.'));
  };
  if (kids === 'y' || kids === 'yes') {
    alert('Well done! They are 3 and 7.');
    correctGuesses = (correctGuesses + 1);
  }
  else if (kids === 'n' || kids === 'no') {
    alert('Actually, he has two boys');
  }
}
function questionTwo ( ) { var kids = prompt ( 'Does Alex have wonderful little boys?' ) . toLowerCase ( ) ; console . log ( 'Does Alex have wonderful little boys?; ' + kids ) ; var wrongType = true ; while ( wrongType === true ) { if ( kids === 'y' || kids === 'n' || kids === 'yes' || kids === 'no' ) { wrongType = false ; } else ( alert ( 'I am not a very smart program, please keep responses to yes/no or y/n.' ) ) ; } ; if ( kids === 'y' || kids === 'yes' ) { alert ( 'Well done! They are 3 and 7.' ) ; correctGuesses = ( correctGuesses + 1 ) ; } else if ( kids === 'n' || kids === 'no' ) { alert ( 'Actually, he has two boys' ) ; } }
checks if user prompt can get the y/n answer, but makes sure its y/n
checks if user prompt can get the y / n answer but makes sure its y / n