As part of my nightwatchjs testing, I have a dynamic array (in an object) that requires some tweaking.
My current array looks like this;
{ GenericColour: [ 'Black',
5059,
'White',
3610,
'Grey',
3281,
'Blue',
2131,
'Silver',
1408,
'Red',
1190,
'',
491,
'Yellow',
59,
'Green',
50,
'Orange',
31 ] }
but with it being dynamic, it might look slightly different the next time I run the test (a different colour might be added, or a current colour no longer listed, etc.).
What I would like to try and do is remove all the numbers, extra commas, etc. so I'm just left with an array reading (as per the example above);
['Black','White','Grey','Blue','Silver','Red','Yellow','Green','Orange']
Is there a way of doing this, either using JavaScript commands or regex?