Skip to content
New issue

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

Iterating only first N items in an array #326

Closed
jmakov opened this issue Jun 26, 2023 · 2 comments
Closed

Iterating only first N items in an array #326

jmakov opened this issue Jun 26, 2023 · 2 comments

Comments

@jmakov
Copy link

jmakov commented Jun 26, 2023

The README mentions iterating through the array using ForEach. I'm wondering if there's a way to iterate only through the first N items in the array. Or would that include a counter and an if statement in the ForEach loop? E.g. how would it look like to iterate through the first 5 items in a json document of the form {data: [[2.3, 3.2], [1,2], ... ]]}?

@volans-
Copy link

volans- commented Jun 26, 2023

This looks very similar to #302. Does one of the proposed solutions there works for you?

@jmakov
Copy link
Author

jmakov commented Jun 26, 2023

Thanks for the quick feedback! I somehow missed that issue. Closing this one.

@jmakov jmakov closed this as completed Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants