You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//Create a combat function that takes the player's current health and the amount of damage recieved, and returns the player's new health. Health can't be less than 0.
function combat(health, damage) {
//P health, damage
//R the player's new health after damage is deducted
//E If health === 5 && damage === 3 return 2
//E If health ===2 && damage ===3 return 0
//P health minus damage is equal to new health. If the damage is greater than health, return 0.