Split(” “) 3 spaces returns 2 empty strings instead of 1?

let threeSpaces = 'a      b';
threeSpaces = threeSpaces.replace(/\s\s+/g, '  ');
const result = threeSpaces.split(' ');
console.log(result);

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top