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

230
Views
¿Por qué JSON analiza el retorno indefinido?

Esta es la cadena que entra:

 "{"eventId":"program-1","eventTimesSelected":{"243759548768171":"2021-11-30T23:00:00Z"}}"

Y falla básicamente, ¿por qué?

 const startPaymentIn2 = localStorage.getItem("startPaymentIn"); let startPaymentIn3 = JSON.parse(startPaymentIn2);

¿Quizás solo el depurador planea divertirse conmigo?

ingrese la descripción de la imagen aquí

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Son las citas, prueba esto en su lugar

Javascript confunde los tres primeros caracteres, "{" es una cadena solitaria.

Puedes leer más sobre cadenas aquí.

 let JSONString = `{"eventId":"program-1","eventTimesSelected":{"243759548768171":"2021-11-30T23:00:00Z"}}` let jsonObject = JSON.parse(JSONString) console.log(jsonObject)

about 4 years ago · Juan Pablo Isaza Report
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!