In the following code:
const names = 'Harry Trump ;Fred Barney; Helen Rigby ; ; ; Bill Abel ;Chris Hand '
let re = /\s*(?:;|$)\s*/;
console.log(names.split(re));
console.log(names.split(re).filter((e) => {return e}));
The second log
statement filters out the empty strings. Why is that so, as I would expect a filter that 'returns itself' to basically do nothing, but it seems to evaluate the truthiness of the expression.