Imagine a scenario where there is a JSON file structured like this:
{
"data": [
{
"id": "1",
"name": "name1"
},
{
"id": "2",
"name": "name2"
}
]
}
If you know the ID, how would you extract the corresponding value of "name" from the JSON file?
This question may seem basic, but as someone new to JavaScript, I am eager to learn from this process. Thank you for your help!