Created
December 26, 2017 21:00
-
-
Save mattborn/f0697cf93d1929a05952c538a1aedc8f to your computer and use it in GitHub Desktop.
52 cards & weeks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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