title: How to pass object or list created through a for loop into JSON.stringify?
body: <pre><code>useEffect( () =&gt; {
          let allCryptoFuturesSymbols = {}
          getOrderRestrictions().then((result) =&gt; {
              let listOfSymbols = result.symbols
              for (let num in listOfSymbols) {
                  let elt = listOfSymbols[num]
                  const symbol = elt[&quot;symbol&quot;]
                  Object.defineProperties(allCryptoFuturesSymbols, {
                      [symbol]: {
                          value: symbol,
                          enumerable: true
                      }
                  });
          })
          console.log(allCryptoFuturesSymbols)
          console.log(JSON.stringify(allCryptoFuturesSymbols))
      }, [])
  </code></pre>
  <p>The output of the first log is correct and expected, and the second is an empty object: {}. If you stringify a manually-defined object there is no problem, but the object created via this for-loop does not behave the same way.</p>