Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. const args = process.argv.slice(2);
  2.  
  3. const rollDice = args => {
  4. let diceRoll = [];
  5.  
  6. for (let i = 0; i < args[0]; i++) {
  7. diceRoll.push(Math.floor(Math.random() * 6) + 1)
  8. }
  9. return "Rolled " + args[0] + " dice: " + diceRoll;
  10. }
  11.  
  12. console.log(rollDice(args));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement