How to use a index value of a dynamic array (which get filled by a click event) for filtering a new array

Hi! I’m looking for someone with javascript knowledge for one particular problem:

How to use a index value of a dynamic array (which get filled by a click event) for filtering a new array?

I hope to hear from you :slight_smile: :eyes:

I’ve stated the question with examples here: https://stackoverflow.com/questions/65052619/how-to-use-a-index-value-of-a-dynamic-array-which-get-filled-by-a-click-event