I was trying to remove empty strings ('') from an javascript array. For example: ['a','b', '', '', '', 'c', ''] ---> ['a', 'b', 'c']
So i tested two commands:
array.splice(array.indexOf(''))
and
array.filter(x => x !== "")
both commands worked. But now i'm confused about their differences.