Created
October 9, 2019 00:14
-
-
Save nrkn/307c0fae86ac972fcbd6d139c900263d to your computer and use it in GitHub Desktop.
This file contains 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 createSequence = (length, cb) => | |
Array.from({length}, ( _v, k ) => cb( k )) | |
// create array of characters a-z | |
const alphaLower = createSequence( | |
26, i => String.fromCharCode( i + 97 ) | |
) | |
// create an array of empty arrays | |
const arr2d = createSequence( 10, () => [] ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment