Skip to content

Commit

Permalink
Convert it to ternary opertor to make it simple
Browse files Browse the repository at this point in the history
  • Loading branch information
kenvilar committed Dec 3, 2017
1 parent 3c8193f commit d297ef7
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@ document.querySelector('.btn-roll-dice').addEventListener('click', function () {
} else {
//Next player
document.querySelector('#current-' + activePlayer).textContent = '0';
if (activePlayer === 1) {
activePlayer = 2;
} else {
activePlayer = 1;
}
activePlayer === 1 ? activePlayer = 2 : activePlayer = 1;
}
});

Expand Down

0 comments on commit d297ef7

Please sign in to comment.