title: How to convert array undefined to array string in javascript
body: <p>I have this</p>
  
  <p><code>const array = [undefined,undefined, undefined]</code></p>
  
  <p>and I would like to convert to this</p>
  
  <p><code>const array = ["","", ""]</code></p>
  
  <p>It's possible ?</p>
  
  <p>I tried this but it's not working</p>
  
  <pre><code> const [text, setText] = useState('');
  
    const replaceUndefinied= (item) =&gt; {
      var str =  JSON.stringify(item, function (key, array) {return (array === undefined) ? setText(array) : array});
      return JSON.parse(str);
   }
  </code></pre>