title: I want to reform this text
body: <p>I want to tranform below text from <code>01   j   dh   sish  kdh   sh j   dhd </code> to <code>01 j dh sish kdh sh j dhd</code></p>
  <pre><code>const reformText = '01    j    dh   sish  kdh          sh j   dhd     h  '
  
  function textTransformer(text) {
  if (!Array.isArray(text)) {
  
      let text2Arr = text.trim().split(' ')
      let pushArr = []
      let finalResult;
  
      text2Arr.map(function (item) {
          if (item.length !== 0) {
              pushArr.push(item)
          }
          finalResult = pushArr.join().replaceAll(',', '')
      })
      console.log(finalResult)
  } else {
      alert('Your DATA STRUCTURE is An ARRAY')
  }
  }
  
  textTransformer(reformText)
  </code></pre>