I am trying to find index of all the instances let's say Header
and Footer
in an array.
var arr = [
'data',
'data',
'data',
'data',
'Header',
'data',
'data',
'data',
'Footer',
'data',
'Header',
'data',
'Footer',
'data'
];
I know how to do this in plain JS (How to find index of all occurrences of element in array?), but I wonder how it would be done in FP, ramda.js
in particular?
I know how to do this for first instance R.findIndex(R.test(_regexForHeader))
but can not wrap my head around looping through all array. Thanks for help.