1 line of code: How to replace multiple spaces with one space
const multiToSingleSpace = str =&gt; str.replace(/  +/g, " ");        Enter fullscreen mode         ...
Tags: javascript, webdev, productivity, codequality