Skip to content

Conversation

@benzaria
Copy link
Contributor

@benzaria benzaria commented Sep 28, 2025

this is a remake of the #1155

  • IndexOf Returns the index of the first occurrence of a value in an array, or never if it is not present.
  • LastIndexOf Returns the index of the last occurrence of a value in an array, or never if it is not present.
  • IndicesOf Returns the indices of all the occurrences of a value in an array, or [] if it is not present.

this version added support for arrays (rest elements) so it returns a negative index if the match is behind the rest element, which will come perfect with the next plan of introducing ArrayAt type.

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

Successfully merging this pull request may close these issues.

1 participant