js/app.js
// player bet, initial bet is hard wired at 5 until
player bet, initial bet is hard wired at 5 until
player bet initial bet is hard wired at 5 until
function playerBet(event) { 
  event.preventDefault();
  bet = parseInt(event.target.betamount.value);
  if (bet < 5){
    alert('The minimum bet is 5');
  } else if (bet > player.bankroll){
    alert(`You can't cover that bet.  Please wager less than ${player.bankroll}`);
  } else {
    player.bankroll -= bet;
    initialDeal();
    betButton.removeEventListener('submit', playerBet);
    hitButton.addEventListener('click', playerHit);
    stayButton.addEventListener('click', playerStay);
    console.log(dealer.handTotal);
    console.log(player.handTotal);
  }
  playerInfo();
  handHistory(playerName, 'bets');
}
function playerBet ( event ) { event . preventDefault ( ) ; bet = parseInt ( event . target . betamount . value ) ; if ( bet < 5 ) { alert ( 'The minimum bet is 5' ) ; } else if ( bet > player . bankroll ) { alert ( ` ${ player . bankroll } ` ) ; } else { player . bankroll -= bet ; initialDeal ( ) ; betButton . removeEventListener ( 'submit' , playerBet ) ; hitButton . addEventListener ( 'click' , playerHit ) ; stayButton . addEventListener ( 'click' , playerStay ) ; console . log ( dealer . handTotal ) ; console . log ( player . handTotal ) ; } playerInfo ( ) ; handHistory ( playerName , 'bets' ) ; }
player bet, initial bet is hard wired at 5 until
player bet initial bet is hard wired at 5 until
//eslint-disable-line  