I have an array:
let array = ['john,1','mars,2','marry,3',' , '];
I want to filter the array in such a way that it should remove extra spaces and only a single comma (without text).
Expected Output:
let array = ['john,1','mars,2','marry,3']
I tried a few methods which removed all the commas.
Please check jsfiddle
Down votes done by those who knows nothing.. :):):)