I have an array of items that looks, for instance, like this:
[el, el, *el*, TARGET, TARGET, TARGET, *el*, el, el, el]
I can't find a way to get previous and subsequent elements relative to the TARGET sequence, i.e both *el*. Number of TARGET element in sequence may vary but the sequence is always concrete i.e TARGET, el, TARGET does not happen. I have access to lodash methods, too, but I couldn't find the correct way to achieve this.
indexOfandlastIndexOf?