js/app.js
//function to output hand history to the DOM
function to output hand history to the DOM
function to output hand history to the DOM
function handHistory(target, action){
  var historyLine = document.createElement('li');
  if (action === 'bets'){
    historyLine.innerHTML = `${target} ${action} -${bet}`;
  } else if (action === 'wins' && target==='Dealer'){
    historyLine.innerHTML = `${target} ${action}`;
  } else if (action === 'wins'){
    historyLine.innerHTML = `${target} ${action} +${bet*2}`;
  } else if (action === 'pushes'){
    historyLine.innerHTML = `${target} ${action} +${bet}`;
  } else if (action === 'BlackJack!'){
    historyLine.innerHTML = `${action} +${bet*2.5}`;
  }
  historyTab.insertAdjacentElement('afterbegin', historyLine);
}
function handHistory ( target , action ) { var historyLine = document . createElement ( 'li' ) ; if ( action === 'bets' ) { historyLine . innerHTML = ` ${ target } ${ action } ${ bet } ` ; } else if ( action === 'wins' && target === 'Dealer' ) { historyLine . innerHTML = ` ${ target } ${ action } ` ; } else if ( action === 'wins' ) { historyLine . innerHTML = ` ${ target } ${ action } ${ bet * 2 } ` ; } else if ( action === 'pushes' ) { historyLine . innerHTML = ` ${ target } ${ action } ${ bet } ` ; } else if ( action === 'BlackJack!' ) { historyLine . innerHTML = ` ${ action } ${ bet * 2.5 } ` ; } historyTab . insertAdjacentElement ( 'afterbegin' , historyLine ) ; }
function to output hand history to the DOM
function to output hand history to the DOM