[...Array(5).keys()] not working in Android
See original GitHub issueIs this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
OS: macOS Sierra 10.12.6 Node: 9.8.0 Yarn: 1.5.1 npm: 5.6.0 Watchman: 4.7.0 Xcode: Xcode 9.2 Build version 9C40b Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed) react: ^16.3.0-alpha.1 => 16.3.0-alpha.2 react-native: 0.54.2 => 0.54.2
Steps to Reproduce
console.log([...Array(2).keys()])
does not produce [0, 1]
.
- Run https://snack.expo.io/SJT6PCPPZ on Android (works)
- Run https://snack.expo.io/H1elODwPb on Android (nothing rendered on screen) Additional note: both works on iOS.
Expected Behavior
https://snack.expo.io/H1elODwPb should render data on screen
Actual Behavior
https://snack.expo.io/H1elODwPb renders nothing on screen
Reproducible Demo
see above
Issue Analytics
- State:
- Created 6 years ago
- Reactions:7
- Comments:14 (6 by maintainers)
Top Results From Across the Web
JS: Array has no method 'keys' (Cordova, Android)
FWIW I get the same output from let data = Array.from(Array(20), new_datum); as I do let data = Array.from(Array(20).keys(), new_datum); if that ...
Read more >Array.prototype.keys() - JavaScript - MDN Web Docs
The keys() method returns a new Array Iterator object that contains the keys for each index in the array. Try it.
Read more >What is [...Array().keys()] : r/learnjavascript - Reddit
Calling .keys() returns an iterator, which lets you iterate over the key values. Important thing at this step is it doesn't return an...
Read more >SparseArray - Android Developers
Note that this container keeps its mappings in an array data structure, using a binary search to find keys. The implementation is not...
Read more >Array | Apple Developer Documentation
If you need an array that is preinitialized with a fixed number of default values, use the Array(repeating:count:) initializer. var digitCounts = Array( ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Workaround:
You’re using a different JavaScript engine when remote JS debugging is turned on - possibly Chrome’s (V8).