Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

245
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda