Created
February 9, 2019 14:05
-
-
Save schabluk/4abcb81f887b88aa6514f8ae08d0b6c8 to your computer and use it in GitHub Desktop.
Alphanumeric Sequences
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
const f = (a, b) => [].concat(...a.map(d => b.map(e => [].concat(d, e)))) | |
const cartesian = (a, b, ...c) => (b ? cartesian(f(a, b), ...c) : a) | |
const letters = Array.from({ length: 26 }, (k, v) => String.fromCharCode(v + 65)) | |
const numbers = Array.from({ length: 9 }, (k, v) => v) | |
console.log(cartesian(letters, numbers)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment