home ~ projects ~ socials

Parse A JSON String In JavaScript

const jsonString = `{ "alfa": true }`
const parsed = JSON.parse(jsonString)
console.log(parsed.alfa)
Output:
true
-- end of line --