'How do I extract data from API by it's description(object)? In this case "Protein"

.then((Object => {
    console.log(Object)
    var data = Object.foods
    var food = data[0]
    var listofnutrients = food.foodNutrients
    var carbs = listofnutrients["protein"]
    console.log(carbs)
}))
{
    "nutrientId": 1003,
    "nutrientName": "Protein",
    "nutrientNumber": "203",
    "unitName": "G",
    "value": 1.19,
    "rank": 600,
    "indentLevel": 1,
    "foodNutrientId": 13209578
}

I want to get a response: "value": 1.19



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source