console.log() a specific value in a JSON object

118
January 08, 2020, at 1:50 PM

I want to take a specific value in the JSON object below and send it to the console. How can I do this using console.log()?

I want to access specific cards in the object, but am currently not able to do so.

{
  "data": [{
    "_id": "5e131eb4ea0c191cdc06f96b",
    "firstName": "Anirudh",
    "lastName": "Singla",
    "gender": "Male",
    "username": "anirudhsingla8",
    "email": "anirudhsingla8@gmail.com",
    "password": "rj13sl1608",
    "cards": [{
      "card_number": "1014220122322233",
      "shopping": 0,
      "food": 0
    }, {
      "card_number": "1014220122322233",
      "shopping": 0,
      "food": 0
    }, {
      "card_number": "1014220122322233",
      "shopping": 0,
      "food": 0
    }, {
      "card_number": "10353975236",
      "CVV": "192",
      "expiryYear": "342",
      "shopping": 0,
      "food": 0
    }, {
      "card_number": "88677677",
      "CVV": "987",
      "expiryYear": "57",
      "shopping": 0,
      "food": 0
    }, {
      "card_number": "88677677",
      "CVV": "987",
      "expiryYear": "57",
      "shopping": 0,
      "food": 0
    }]
  }]
}
READ ALSO
How to build a typescript project with a nodejs server

How to build a typescript project with a nodejs server

I want to build a project from my fileserver using nodejsI want to run the package

98
Why is my data not added to the heroku sandbox database?

Why is my data not added to the heroku sandbox database?

I created a node/React App, which I deployed to herokuWhen I post data in my local env, the data is added to the database

91
How to avoid adding “async” to hundreds of locations in my code when adding a simple fetch call? [closed]

How to avoid adding “async” to hundreds of locations in my code when adding a simple fetch call? [closed]

Want to improve this question? Update the question so it focuses on one problem only by editing this post

113
How to use Child-Process for typescript [closed]

How to use Child-Process for typescript [closed]

Want to improve this question? Update the question so it's on-topic for Stack Overflow

210