JSFiddle - React, Tailwind, and code Playground

HTML

<div id='output' class='text'>
</div>

CSS

.text {
  border: 1px solid black;
  text-align: justify;
  width: 200px;
  height: auto;
}

JavaScript

var output = document.getElementById('output'),
  text = 'I\'m a justified  text with multiple    spaces between      words. Really cool,  so js. Found better workaround? Email me   sf-shakal@mail.ru!';

text = text.replace(/\s/g, '&#8203; ');
output.innerHTML = text;