Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

213
Views
How to pass object or list created through a for loop into JSON.stringify?
useEffect( () => {
        let allCryptoFuturesSymbols = {}
        getOrderRestrictions().then((result) => {
            let listOfSymbols = result.symbols
            for (let num in listOfSymbols) {
                let elt = listOfSymbols[num]
                const symbol = elt["symbol"]
                Object.defineProperties(allCryptoFuturesSymbols, {
                    [symbol]: {
                        value: symbol,
                        enumerable: true
                    }
                });
        })
        console.log(allCryptoFuturesSymbols)
        console.log(JSON.stringify(allCryptoFuturesSymbols))
    }, [])

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.

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!