Skip to content

Instantly share code, notes, and snippets.

@mattborn
Created December 26, 2017 21:00
Show Gist options
  • Save mattborn/f0697cf93d1929a05952c538a1aedc8f to your computer and use it in GitHub Desktop.
Save mattborn/f0697cf93d1929a05952c538a1aedc8f to your computer and use it in GitHub Desktop.
52 cards & weeks
// There are 52 weeks in a year. Usually.
// There are 52 cards in a deck.
// Let’s generate an alternate sequential reference for weeks.
let weeks = [];
const faces = [2,3,4,5,6,7,8,9,'T','J','Q','K','A']
const suits = ['♣','♦','♥','♠'];
suits.forEach(suit => {
faces.forEach(face => {
weeks.push(face + suit);
});
});
console.log(weeks);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment