Last active
March 13, 2018 03:49
-
-
Save jtara1/7da4b5e58960163d16c96bf9c99cdd39 to your computer and use it in GitHub Desktop.
alpha-numeric-list generation yields empty Array within React Native app but works in chrome console
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
let alphabet = [...Array(26).keys()] | |
.map(x => x + 65) | |
.map(x => String.fromCharCode(x)); | |
console.log(alphabet); | |
// [0, 1, ..., 9, A, B, C, ..., Z] | |
// let alphanumericCharacters = _.concat(_.range(10), alphabet); | |
let alphanumericCharacters = [...Array(10).keys()] | |
.concat(alphabet); | |
console.log(alphanumericCharacters); | |
// alphanumericCharacters = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F']; | |
// I endend up using lodash library to do the same thing that ES6 JS should let me do |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment