Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

239
Vistas
Convert no quoted dictionary keys to double quoted keys in JS

I have json format string that has keys without inverted commas. So I am not able to parse this string to json using var jsonV = JSON.parse(fileStr). How can I put the keys of dictionary into inverted commas and then parse the string to json? Below is the example string I want to parse into json.

{
  title: 'Service Requests',
  navTitle: 'Service Requests',
  headers: {
    id: 'ID',
    priority: 'Priority',
    status: 'Status',
  },
}

I am getting this as string only. I want to parse this into JSON.

Edit: I tried this and this links. But none of these answered my question. These doesn't take the condition that if we have only string having json elements without inverted commas like in below example. (I cant even iterated through this string object as)

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda