Here is a JSON response I received from a remote server:
{
"string": [
{
"id": 223,
"name": "String",
"sug": "string",
"description": "string",
"jId": 530,
"pcs": [{
"id": 24723,
"name": "String",
"sug": "string"
}]
}, {
"id": 247944,
"name": "String",
"sug": "string",
"description": "string",
"jlId": 531,
"pcs": [{
"id": 24744,
"name": "String",
"sug": "string"
}]
}
]
}
To extract and list the "name" & "description" values from this response, I have created the following code:
interface MyObj {
name: string
desc: string
}
let obj: MyObj = JSON.parse(data.toString());
I'm now looking for help on how to display the extracted "name" and "description" in a format that can be easily shown on a webpage.