I have an object list with a large number of elements of Test
:
Test:{name:'', creator:''}
Require to extract a unique creators list from that list. I have tried:
const creators = Array.from(new Set(tests.map(t=>t.creator))
This works fine but, due to rapid changes, I have to call this again and again. So, this takes more time and lags the UI. How to build this array more efficiently than the current implementation?
EDIT:
Context information:
Require unique element array(not set) due to rendering on UI by
tests.map(test=><Test data={test}/>)