Ad

qwe

Code
Diff
  • const rps=(a, b)=>a==b?'Draw!':'Player '+(['scissorsrock','paperscissors','rockpaper'].includes(a+b)+1)+' won!';
    
    • function rps(player1, player2) {
    • return player1 == player2 ? 'Draw!' :
    • player1 == 'rock' && player2 == 'scissors' ||
    • player1 == 'scissors' && player2 == 'paper' ||
    • player1 == 'paper' && player2 == 'rock' ? 'Player 1 won!' : 'Player 2 won!';
    • }
    • const rps=(a, b)=>a==b?'Draw!':'Player '+(['scissorsrock','paperscissors','rockpaper'].includes(a+b)+1)+' won!';
Code
Diff
  • yearlyElectricCosts=(...c)=>(r=>+`${r[0]}.${r[1].slice(0,2)}`)((''+c.reduce((a,b)=>a+b)).split`.`)
    • yearlyElectricCosts=(...c)=>(r=>+`${r[0]}.${r[1].slice(0,2)}`)((``+c.reduce((a,b)=>a+b)).split`.`)
    • yearlyElectricCosts=(...c)=>(r=>+`${r[0]}.${r[1].slice(0,2)}`)((''+c.reduce((a,b)=>a+b)).split`.`)