JSFiddle - React, Tailwind, and code Playground

by ovfiddle

JavaScript

[
    'Quick       Brown Fox      Jumps Over the Lazy               Dog',
    'Quick Brown Fox     Jumps Over the Lazy \
            \
    Dog',
    'Quick Brown Fox Jumps Over the Lazy Dog',
].forEach(function(_str){
    console.log(_str.replace(/[ ]+/g, ' '));
    //alternatively, to replace *all* whitespace including \t\r\n
    //console.log(_str.replace(/\s+/g, ' '));
});