JAVASCRIPT Code Replaces Tabs & Multiple Spaces w/Single Space and KEEP Line Breaks!!

Javascript One Line Code to Replace ALL Tabs and Multiple Spaces with a Single Space but KEEP LINE BREAKS ALONE

Home Short:

I was utterly amazed there was no solution for this online. When searching for replace tabs and multiple spaces with single space and keep line breaks all that came up was search results for REMOVING the line breaks but nothing for keeping the line breaks alone or intact..

The first replace replaces all tabs with spaces and the second replace function replaces multiple spaces with single space.

S
H
A
R
E