Skip to content

Instantly share code, notes, and snippets.

@AllGistsEqual
Created February 11, 2020 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AllGistsEqual/21c7d8827aa957550d5190a3ccd15c9c to your computer and use it in GitHub Desktop.
Save AllGistsEqual/21c7d8827aa957550d5190a3ccd15c9c to your computer and use it in GitHub Desktop.
// let's add out dice in a game
const dicePool = [5, 2, 4]
const firstDiceThrow = [1, 4, 6]
const secondDiceThrow = [3, 6, 1]
console.log(dicePool) // [5, 2, 4]
dicePool.push(...firstDiceThrow, ...secondDiceThrow)
console.log(dicePool) // [5, 2, 4, 1, 4, 6, 3, 6, 1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment