Skip to content

Instantly share code, notes, and snippets.

@rodrwan
Created July 31, 2017 17:24
Show Gist options
  • Save rodrwan/0cb6562cbd1b2871363153202bb638de to your computer and use it in GitHub Desktop.
Save rodrwan/0cb6562cbd1b2871363153202bb638de to your computer and use it in GitHub Desktop.
const palos = ['c', 'p', 't','d']
const barajas = []
const cartas = 13
for (let i = 0; i < palos.length; i++) {
for (let j = 1; j <= cartas; j++) {
const carta = {
palo: palos[i],
valor: j,
}
barajas.push(carta)
}
}
console.log(JSON.stringify(barajas, null, 2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment