We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hope to support the index of the iterator
keyBy(['a', 'b'], (_, index) => index);
{ 0: 'a', 1: 'b', }
{ undefined: 'b', }
The text was updated successfully, but these errors were encountered:
You can try with this for the time being.
Example
const array1 = ['a', 'b']; const array2 = [ { 'dir': 'left', 'code': 97 }, { 'dir': 'right', 'code': 100 } ]; console.log( keyBy(array1, _ => array1.indexOf(_)) ); console.log( keyBy(array2, _ => array2.indexOf(_)) );
Actual Result
{ 0: 'a', 1: 'b' } { 0: { dir: 'left', code: 97 }, 1: { dir: 'right', code: 100 } }
Sorry, something went wrong.
Raised a pull request (#5798).
No branches or pull requests
VERSION 4.17.21
Hope to support the index of the iterator
Example
Expected Result
Actual Result
The text was updated successfully, but these errors were encountered: