Answer the question
In order to leave comments, you need to log in
How to get all indexes of a given element in an array?
Is it possible to find out all indexes of a given element in an array? If so, how? I tried to solve this problem through the "index" method, but it returns the index only for the first element in the array. Thanks in advance for your reply.
Array example:
[ "|" , "a", "b", "|", "c," "d" , "f" , "|" , "|" ]
Example task
Get all indexes with value "|" .
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question