Skip to content

Instantly share code, notes, and snippets.

@fdaciuk
Created December 10, 2021 11:47
Show Gist options
  • Save fdaciuk/8d49c0398af42714d5269cbfad90c594 to your computer and use it in GitHub Desktop.
Save fdaciuk/8d49c0398af42714d5269cbfad90c594 to your computer and use it in GitHub Desktop.
try {
const mensagem = JSON.parse(obj.mensagem)
console.log(mensagem) // {...}
} catch (e) {
console.log(obj.mensagem) // "Hello"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment